summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_login.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-12-19 17:05:48 +0000
committerRobert Pösel <robyer@seznam.cz>2015-12-19 17:05:48 +0000
commit96ff0746ac203f99d5e51d720dfbd4baf6fdd766 (patch)
tree6ac5a152da488704250e24c5f5ad76f874ef21c1 /protocols/Steam/src/steam_login.cpp
parent9b76f4f1e734be9cfb8d3cbd2823b668248a3462 (diff)
Steam: Try to login again automatically when our token is expired already at login
git-svn-id: http://svn.miranda-ng.org/main/trunk@15899 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_login.cpp')
-rw-r--r--protocols/Steam/src/steam_login.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp
index 7000a0942d..7bf093951f 100644
--- a/protocols/Steam/src/steam_login.cpp
+++ b/protocols/Steam/src/steam_login.cpp
@@ -284,16 +284,31 @@ void CSteamProto::OnGotSession(const HttpResponse *response)
void CSteamProto::HandleTokenExpired()
{
- // Notify error to user
- ShowNotification(_T("Steam"), TranslateT("Connection token expired. Please login again."));
-
// Delete expired token
delSetting("TokenSecret");
- // Set status to offline
- SetStatus(ID_STATUS_OFFLINE);
+ // Try to relogin automatically (but only once)
+ if (isLoginAgain) {
+ // Notify error to user
+ ShowNotification(_T("Steam"), TranslateT("Cannot obtain connection token."));
+
+ // Just go offline; it also resets the isLoginAgain to false
+ SetStatus(ID_STATUS_OFFLINE);
+ }
+ else
+ {
+ // Remember we are trying to relogin
+ isLoginAgain = true;
+
+ // Remember status user wanted
+ int desiredStatus = m_iDesiredStatus;
- // TODO: Try to login again acutomatically (at least once)
+ // Set status to offline
+ SetStatus(ID_STATUS_OFFLINE);
+
+ // Try to login again automatically
+ SetStatus(desiredStatus);
+ }
}
void CSteamProto::OnLoggedOn(const HttpResponse *response)