From 15b2ea9e4e7077b8547f5f7f39156b0227c338e8 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 30 Nov 2017 11:56:59 +0900 Subject: Connection: no more default to matrix.org; update HS URL from /login response --- connection.cpp | 8 ++++---- connection.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/connection.cpp b/connection.cpp index c29f09fe..3e4f1efb 100644 --- a/connection.cpp +++ b/connection.cpp @@ -77,10 +77,9 @@ Connection::Connection(const QUrl& server, QObject* parent) d->q = this; // All d initialization should occur before this line } -Connection::Connection() - : Connection(QUrl("https://matrix.org")) -{ -} +Connection::Connection(QObject* parent) + : Connection({}, parent) +{ } Connection::~Connection() { @@ -165,6 +164,7 @@ void Connection::doConnectToServer(const QString& user, const QString& password, deviceId, initialDeviceName); connect(loginJob, &BaseJob::success, this, [=] { + setHomeserver(loginJob->homeServer()); d->connectWithToken(loginJob->userId(), loginJob->accessToken(), loginJob->deviceId()); }); diff --git a/connection.h b/connection.h index fc6f4588..ecebb2e7 100644 --- a/connection.h +++ b/connection.h @@ -57,8 +57,8 @@ namespace QMatrixClient using user_factory_t = std::function; + explicit Connection(QObject* parent = nullptr); explicit Connection(const QUrl& server, QObject* parent = nullptr); - Connection(); virtual ~Connection(); QHash, Room*> roomMap() const; -- cgit v1.2.3