From 404e37d64a71baf3c9ca44ed2a16288876fb2995 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 10 Dec 2017 15:29:40 +0900 Subject: Fix setting the homeserver hostname (not URL) coming from /login --- connection.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'connection.cpp') 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; -- cgit v1.2.3