From b9c5c06d53f5b3927e125ec46e3d1d7efcae6f12 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 28 Sep 2020 00:30:13 +0200 Subject: Matrix: remove deprecated login method Scroll to bottom if the last item is the selected item, or when selecting another room. --- src/plugins/Matrix.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index d709f73..d364b16 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -832,11 +832,13 @@ namespace QuickMedia { } PluginResult Matrix::login(const std::string &username, const std::string &password, const std::string &homeserver, std::string &err_msg) { - // TODO: this is deprecated but not all homeservers have the new version. - // When this is removed from future version then switch to the new login method (identifier object with the username). + Json::Value identifier_json(Json::objectValue); + identifier_json["type"] = "m.id.user"; // TODO: What if the server doesn't support this login type? redirect to sso web page etc + identifier_json["user"] = username; + Json::Value request_data(Json::objectValue); request_data["type"] = "m.login.password"; - request_data["user"] = username; + request_data["identifier"] = std::move(identifier_json); request_data["password"] = password; Json::StreamWriterBuilder builder; -- cgit v1.2.3