summary refs log tree commit diff
path: root/src/MatrixClient.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-03-01 09:31:08 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-03-01 09:31:08 +0200
commit735d508a29f2e67f1082ee922ee61ce9dec21c8a (patch)
tree9f878c54d80b2aa7ba79e5fbd184ad10297e22d2 /src/MatrixClient.cc
parentPropagate errors during /login & /versions (diff)
downloadnheko-735d508a29f2e67f1082ee922ee61ce9dec21c8a.tar.xz
Handle empty matrix ID (regression from 9de1ec1)
fixes #259
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());