summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/VKontakte/src/misc.cpp12
-rw-r--r--protocols/VKontakte/src/vk.h1
2 files changed, 13 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)
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h
index ff1914446f..296fcc3b19 100644
--- a/protocols/VKontakte/src/vk.h
+++ b/protocols/VKontakte/src/vk.h
@@ -52,6 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VKERR_FLOOD_CONTROL 9 // Flood control
#define VKERR_INTERNAL_SERVER_ERR 10 // Internal server error
#define VKERR_CAPTCHA_NEEDED 14 // Captcha needed
+#define VKERR_ACCESS_DENIED 15 // Access denied
#define VKERR_COULD_NOT_SAVE_FILE 105 // Couldn't save file
#define VKERR_INVALID_ALBUM_ID 114 // Invalid album id
#define VKERR_INVALID_SERVER 118 // Invalid server