diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-12-19 14:33:22 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-12-19 14:33:22 +0000 |
commit | 72081f42fdffee1ebca970020d6cb573cf33aff8 (patch) | |
tree | 9fa783785c7e7faded4ea150c4ecff86dee8fa0b /protocols/Steam/src | |
parent | 13490b08d3f448e1654e9e17b0ab61792fad4fdf (diff) |
Steam: Fix handling expired token at login
git-svn-id: http://svn.miranda-ng.org/main/trunk@15894 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r-- | protocols/Steam/src/steam_login.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index 9520bf0bd1..112bad8592 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -256,13 +256,24 @@ void CSteamProto::HandleTokenExpired() // Set status to offline
SetStatus(ID_STATUS_OFFLINE);
+
+ // TODO: Try to login again acutomatically (at least once)
}
void CSteamProto::OnLoggedOn(const HttpResponse *response)
{
if (!CheckResponse(response))
{
+ if (response->resultCode == HTTP_CODE_UNAUTHORIZED)
+ {
+ // Probably expired TokenSecret
+ HandleTokenExpired();
+ return;
+ }
+
// Probably timeout or no connection, we can do nothing here
+ ShowNotification(_T("Steam"), TranslateT("Unknown login error."));
+
SetStatus(ID_STATUS_OFFLINE);
return;
}
@@ -271,7 +282,7 @@ void CSteamProto::OnLoggedOn(const HttpResponse *response) JSONNode *node = json_get(root, "error");
ptrT error(json_as_string(node));
- if (mir_tstrcmpi(error, _T("OK")) || response->resultCode == HTTP_CODE_UNAUTHORIZED)
+ if (mir_tstrcmpi(error, _T("OK")))
{
// Probably expired TokenSecret
HandleTokenExpired();
|