summary refs log tree commit diff
path: root/src/MatrixClient.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/MatrixClient.cc')
-rw-r--r--src/MatrixClient.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/MatrixClient.cc b/src/MatrixClient.cc

index bcf7a62b..544f58cb 100644 --- a/src/MatrixClient.cc +++ b/src/MatrixClient.cc
@@ -123,11 +123,6 @@ MatrixClient::login(const QString &username, const QString &password) noexcept int status_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - if (reply->error()) { - emit loginError(reply->errorString()); - return; - } - if (status_code == 403) { emit loginError(tr("Wrong username or password")); return; @@ -144,6 +139,11 @@ MatrixClient::login(const QString &username, const QString &password) noexcept return; } + if (reply->error()) { + emit loginError(reply->errorString()); + return; + } + try { mtx::responses::Login login = nlohmann::json::parse(reply->readAll().data());