diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-12-28 10:53:32 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-12-28 10:53:32 +0000 |
commit | c7c1a75a0748eb688cc87796f6bd0d1dfd2923a1 (patch) | |
tree | b1f861cfece2f012a604a0f752a4ab7bf8b28de1 /protocols/VKontakte/src/misc.cpp | |
parent | 28e41061006a42d0866fbb68c65834e77f896fa4 (diff) |
Vkontakte:
add access denied error processing
access token auto requered if permission was change
git-svn-id: http://svn.miranda-ng.org/main/trunk@11662 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index cb28afb644..83231b2228 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -248,6 +248,17 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, JSONNODE *pNode) case VKERR_AUTHORIZATION_FAILED:
ConnectionFailed(LOGINERR_WRONGPASSWORD);
break;
+ 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();
+ return false;
+ }
+ debugLogA("CVkProto::CheckJsonResult VKERR_ACCESS_DENIED");
+ MsgPopup(NULL, TranslateT("Access denied! Data will not be sent or received."), TranslateT("Error"), true);
+ break;
case VKERR_CAPTCHA_NEEDED:
ApplyCaptcha(pReq, pError);
break;
@@ -886,6 +897,7 @@ CMString CVkProto::SetBBCString(TCHAR *tszString, VKBBCType bbcType, TCHAR *tszA CMString res;
if (ptszFormat == NULL)
return CMString(tszString);
+
if (bbcType == vkbbcUrl && m_iBBCForNews != bbcAdvanced)
res.AppendFormat(ptszFormat, tszString ? tszString : _T(""), tszAddString ? tszAddString : _T(""));
else if (m_iBBCForNews == bbcAdvanced && bbcType >= vkbbcUrl)
|