From 5ce4a9b40179307f4f211b5bf709a4b8747a5eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Wed, 20 May 2015 11:07:27 +0000 Subject: Steam: Prepare deleting token only when server return code 401 This solves problem of deleting token even if it's still valid but just request got timeout. But it doesn't work yet, because we will got "response == null" as parameter. git-svn-id: http://svn.miranda-ng.org/main/trunk@13714 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_account.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'protocols/Steam/src') diff --git a/protocols/Steam/src/steam_account.cpp b/protocols/Steam/src/steam_account.cpp index 0cdbc95f80..942095d150 100644 --- a/protocols/Steam/src/steam_account.cpp +++ b/protocols/Steam/src/steam_account.cpp @@ -228,9 +228,8 @@ void CSteamProto::OnLoggedOn(const NETLIBHTTPREQUEST *response, void *) { if (response == NULL) { - // Probably expired TokenSecret - // FIXME: no response could be also when there is no internet connection available! and in that case it shouldn't delete the token from db... - HandleTokenExpired(); + // Probably timeout or no connection, we can do nothing here + SetStatus(ID_STATUS_OFFLINE); return; } @@ -238,7 +237,7 @@ void CSteamProto::OnLoggedOn(const NETLIBHTTPREQUEST *response, void *) JSONNODE *node = json_get(root, "error"); ptrT error(json_as_string(node)); - if (mir_tstrcmpi(error, _T("OK"))/* || response->resultCode == HTTP_STATUS_UNAUTHORIZED*/) + if (mir_tstrcmpi(error, _T("OK")) || response->resultCode == HTTP_STATUS_UNAUTHORIZED) { // Probably expired TokenSecret HandleTokenExpired(); -- cgit v1.2.3