From 6825486776289a9b648684a412dccf2b77db5e08 Mon Sep 17 00:00:00 2001 From: Kevin Boxhoorn Date: Thu, 29 Sep 2016 12:21:06 +1000 Subject: [PATCH] Prevent login error handler being incorrectly called (#2176) In some situations, when the server disconnects the client during a login, multiple dialogs will be shown. This is undesirable behavior, and hence `loginError` should only be called when the client is actually connected (`response.response_code() != Response::RespNotConnected`). --- cockatrice/src/remoteclient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/remoteclient.cpp b/cockatrice/src/remoteclient.cpp index cd664d36..f63ce12d 100644 --- a/cockatrice/src/remoteclient.cpp +++ b/cockatrice/src/remoteclient.cpp @@ -152,7 +152,7 @@ void RemoteClient::loginResponse(const Response &response) if (resp.missing_features_size() > 0 && settingsCache->getNotifyAboutUpdates()) emit notifyUserAboutUpdate(); - } else { + } else if (response.response_code() != Response::RespNotConnected) { QList missingFeatures; if (resp.missing_features_size() > 0) { for (int i = 0; i < resp.missing_features_size(); ++i) @@ -379,4 +379,4 @@ QString RemoteClient::getSrvClientID(const QString _hostname) } QString uniqueServerClientID = QCryptographicHash::hash(srvClientID.toUtf8(), QCryptographicHash::Sha1).toHex().right(15); return uniqueServerClientID; -} \ No newline at end of file +}