parent
f6c279f6f2
commit
735d508a29
3 changed files with 30 additions and 43 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue