From 5d9d56a4fe9f3178c8bc9b3839ec608659c0c371 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Fri, 5 Jul 2019 10:15:54 +0800 Subject: Clean up .well-known logic --- lib/connection.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/connection.cpp b/lib/connection.cpp index 4391a1b2..98555104 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -203,13 +203,12 @@ void Connection::resolveServer(const QString& mxidOrDomain) connect(job, &BaseJob::finished, [this, job, maybeBaseUrl] { QUrl baseUrl(job->data().homeserver.baseUrl); if (!baseUrl.isValid() || job->status() != BaseJob::Success) { - baseUrl = maybeBaseUrl; - qCDebug(MAIN) << maybeBaseUrl.host() << "doesn't have .well-known record" << "- using the hostname as is"; + qCDebug(MAIN) << maybeBaseUrl.host() << "doesn't have valid .well-known file" << "- using the hostname as is"; } else { qCDebug(MAIN) << ".well-known for" << maybeBaseUrl.host() << "is" << baseUrl.authority(); + setHomeserver(baseUrl); } - setHomeserver(baseUrl); emit resolved(); job->deleteLater(); }); -- cgit v1.2.3