summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-10-29 18:24:58 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-10-29 18:24:58 +0000
commitf9526af6e2236193cbd5bbab7af5d8e386c2233e (patch)
tree5ba58e6af180b642c6a491247f9e32b13db66bc9 /protocols/VKontakte/src/misc.cpp
parent13045806fbae565ae8062166a328633622a0dcb9 (diff)
VKontakte:
fix for cleaning access token on login or password change version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@15649 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 3d77b0b0a4..8d1661fcc4 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -134,6 +134,15 @@ char* ExpUrlEncode(const char *szUrl, bool strict)
/////////////////////////////////////////////////////////////////////////////////////////
+void CVkProto::ClearAccessToken()
+{
+ debugLogA("CVkProto::ClearAccessToken");
+ setDword("LastAccessTokenTime", (DWORD)time(NULL));
+ m_szAccessToken = NULL;
+ delSetting("AccessToken");
+ ShutdownSession();
+}
+
TCHAR* CVkProto::GetUserStoredPassword()
{
debugLogA("CVkProto::GetUserStoredPassword");
@@ -253,9 +262,7 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, const JSONNode &jnNode)
case VKERR_ACCESS_DENIED:
if (time(NULL) - getDword("LastAccessTokenTime", 0) > 60 * 60 * 24) {
debugLogA("CVkProto::CheckJsonResult VKERR_ACCESS_DENIED (AccessToken fail?)");
- setDword("LastAccessTokenTime", (DWORD)time(NULL));
- delSetting("AccessToken");
- ShutdownSession();
+ ClearAccessToken();
return false;
}
debugLogA("CVkProto::CheckJsonResult VKERR_ACCESS_DENIED");