diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-10 15:29:40 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-10 16:16:59 +0900 |
commit | 404e37d64a71baf3c9ca44ed2a16288876fb2995 (patch) | |
tree | 34f70f45c71bf74f69e7ae8b6d20b48d69dc7795 /connection.cpp | |
parent | 1796fb03406bc0a12a513218f6aaa34e9cd60734 (diff) | |
download | libquotient-404e37d64a71baf3c9ca44ed2a16288876fb2995.tar.gz libquotient-404e37d64a71baf3c9ca44ed2a16288876fb2995.zip |
Fix setting the homeserver hostname (not URL) coming from /login
Diffstat (limited to 'connection.cpp')
-rw-r--r-- | connection.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/connection.cpp b/connection.cpp index 3e4f1efb..368abc8e 100644 --- a/connection.cpp +++ b/connection.cpp @@ -164,7 +164,8 @@ void Connection::doConnectToServer(const QString& user, const QString& password, deviceId, initialDeviceName); connect(loginJob, &BaseJob::success, this, [=] { - setHomeserver(loginJob->homeServer()); + setHomeserver(QUrl::fromUserInput( + homeserver().scheme() + "://" + loginJob->homeServer())); d->connectWithToken(loginJob->userId(), loginJob->accessToken(), loginJob->deviceId()); }); @@ -488,11 +489,11 @@ QByteArray Connection::generateTxnId() void Connection::setHomeserver(const QUrl& url) { - if (d->data->baseUrl() == url) + if (homeserver() == url) return; d->data->setBaseUrl(url); - emit homeserverChanged(url); + emit homeserverChanged(homeserver()); } static constexpr int CACHE_VERSION_MAJOR = 1; |