diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-10-13 19:57:01 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-10-13 19:57:01 +0200 |
commit | 0aa70ed9b3cff3c9e0dbbea9beb419d840e42341 (patch) | |
tree | 2c0d85a55e7ae2428faa82bdbe727fccd8c9e8b4 | |
parent | b7de9c00b79ef0d187190aa5d126bff7503f471f (diff) | |
download | libquotient-0aa70ed9b3cff3c9e0dbbea9beb419d840e42341.tar.gz libquotient-0aa70ed9b3cff3c9e0dbbea9beb419d840e42341.zip |
Connection::resolveServer(): don't connect to loginFlowsJob
Checking whether any login flows are available is a good enough measure
of the homeserver actual workability. Closes #515.
-rw-r--r-- | lib/connection.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 1fe0d2d0..2ad10694 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -316,10 +316,6 @@ void Connection::resolveServer(const QString& mxid) setHomeserver(maybeBaseUrl); } Q_ASSERT(d->loginFlowsJob != nullptr); // Ensured by setHomeserver() - connect(d->loginFlowsJob, &BaseJob::failure, this, [this] { - qCWarning(MAIN) << "Homeserver base URL sanity check failed"; - emit resolveError(tr("The homeserver doesn't seem to be working")); - }); }); } @@ -478,10 +474,11 @@ void Connection::Private::checkAndConnect(const QString& userId, connectFn(); else emit q->loginError( + tr("Unsupported login flow"), tr("The homeserver at %1 does not support" " the login flow '%2'") - .arg(data->baseUrl().toDisplayString()), - flow->type); + .arg(data->baseUrl().toDisplayString(), + flow->type)); }); else connectSingleShot(q, &Connection::homeserverChanged, q, connectFn); |