diff --git a/include/mtx/responses/login.hpp b/include/mtx/responses/login.hpp index 492b1653fce542180aaae2e5caf11de7da2086fc..290d632634e9c11946f63379a01f90752472a5fa 100644 --- a/include/mtx/responses/login.hpp +++ b/include/mtx/responses/login.hpp @@ -19,9 +19,6 @@ struct Login //! An access token for the account. //! This access token can then be used to authorize other requests. std::string access_token; - //! The hostname of the homeserver on which the account has been registered. - [[deprecated("Clients should extract the server_name from user_id (by splitting at the " - "first colon) if they require it.")]] std::string home_server; //! ID of the logged-in device. //! Will be the same as the corresponding parameter in the request, if one was specified. std::string device_id; diff --git a/lib/structs/responses/login.cpp b/lib/structs/responses/login.cpp index 4091e9baab026116137174718df38af44da27482..2680aa5a13b42b3801f3e3797196ad3d03220b76 100644 --- a/lib/structs/responses/login.cpp +++ b/lib/structs/responses/login.cpp @@ -13,9 +13,6 @@ from_json(const json &obj, Login &response) response.access_token = obj.at("access_token").get<std::string>(); - if (obj.count("home_server") != 0) - response.home_server = obj.at("home_server").get<std::string>(); - if (obj.count("device_id") != 0) response.device_id = obj.at("device_id").get<std::string>(); diff --git a/tests/client_api.cpp b/tests/client_api.cpp index 749fb6c6ac6d2a67e988f788b9db783c5fd6921f..9e7e1459dba75e7ae09b26188215a0718f4de1da 100644 --- a/tests/client_api.cpp +++ b/tests/client_api.cpp @@ -94,7 +94,6 @@ TEST(ClientAPI, LoginWrongPassword) EXPECT_EQ(res.user_id.to_string(), ""); EXPECT_EQ(res.device_id, ""); - EXPECT_EQ(res.home_server, ""); EXPECT_EQ(res.access_token, ""); }); @@ -112,7 +111,6 @@ TEST(ClientAPI, LoginWrongUsername) EXPECT_EQ(res.user_id.to_string(), ""); EXPECT_EQ(res.device_id, ""); - EXPECT_EQ(res.home_server, ""); EXPECT_EQ(res.access_token, ""); }); diff --git a/tests/responses.cpp b/tests/responses.cpp index 01b10cc9c958f081d423f5cc3cbd3e8bcc007ca0..917426f57994bab5839796897f55d8e834825ff7 100644 --- a/tests/responses.cpp +++ b/tests/responses.cpp @@ -508,7 +508,6 @@ TEST(Responses, Login) Login login = data; EXPECT_EQ(login.user_id.to_string(), "@cheeky_monkey:matrix.org"); EXPECT_EQ(login.access_token, "abc123"); - EXPECT_EQ(login.home_server, "matrix.org"); EXPECT_EQ(login.device_id, "GHTYAJCE"); EXPECT_EQ(login.well_known->homeserver.base_url, "https://example.org"); EXPECT_EQ(login.well_known->identity_server->base_url, "https://id.example.org"); @@ -522,7 +521,6 @@ TEST(Responses, Login) Login login2 = data2; EXPECT_EQ(login2.user_id.to_string(), "@cheeky_monkey:matrix.org"); EXPECT_EQ(login2.access_token, "abc123"); - EXPECT_EQ(login2.home_server, "matrix.org"); EXPECT_EQ(login2.device_id, ""); json data3 = R"({ @@ -532,7 +530,6 @@ TEST(Responses, Login) Login login3 = data3; EXPECT_EQ(login3.user_id.to_string(), "@cheeky_monkey:matrix.org"); EXPECT_EQ(login3.access_token, "abc123"); - EXPECT_EQ(login3.home_server, ""); EXPECT_EQ(login3.device_id, ""); } diff --git a/tests/test_helpers.hpp b/tests/test_helpers.hpp index e30f0ec122fbd6864645f396e5f0fb7fd2c85c19..e90336257844753c05dcb112d78cff14eb67739f 100644 --- a/tests/test_helpers.hpp +++ b/tests/test_helpers.hpp @@ -59,7 +59,6 @@ inline void validate_login(const std::string &user, const mtx::responses::Login &res) { EXPECT_EQ(res.user_id.to_string(), user); - EXPECT_EQ(res.home_server, "localhost"); ASSERT_TRUE(res.access_token.size() > 100); ASSERT_TRUE(res.device_id.size() > 5); }