summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/VKontakte/src/misc.cpp15
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk_captcha.cpp3
3 files changed, 15 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 2f669795fe..0d91df22d4 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -393,7 +393,20 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, const JSONNode &jnNode)
MsgPopup(TranslateT("Access denied! Data will not be sent or received."), TranslateT("Error"), true);
break;
case VKERR_CAPTCHA_NEEDED:
- ApplyCaptcha(pReq, jnError);
+ if (!ApplyCaptcha(pReq, jnError) && (pReq->m_iRetry > 0)) {
+ pReq->bNeedsRestart = true;
+ Sleep(1000);
+ debugLogA("CVkProto::CheckJsonResult Captcha processing error.");
+ debugLogA("CVkProto::CheckJsonResult Retry = %d", pReq->m_iRetry);
+ pReq->m_iRetry--;
+ } else {
+ CMStringW wszMsg(FORMAT, TranslateT("Error %d. Data will not be sent or received."), iErrorCode);
+ wszMsg += "\n";
+ wszMsg += TranslateT("Captcha processing error.");
+ MsgPopup(wszMsg, TranslateT("Error"), true);
+ debugLogA("CVkProto::CheckJsonResult SendError");
+ }
+
break;
case VKERR_VALIDATION_REQUIRED: // Validation Required
MsgPopup(TranslateT("You have to validate your account before you can use VK in Miranda NG"), TranslateT("Error"), true);
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index 9739601f53..93f8f02f7b 100644
--- a/protocols/VKontakte/src/version.h
+++ b/protocols/VKontakte/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 18
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk_captcha.cpp b/protocols/VKontakte/src/vk_captcha.cpp
index 0572c46837..7162a4cb11 100644
--- a/protocols/VKontakte/src/vk_captcha.cpp
+++ b/protocols/VKontakte/src/vk_captcha.cpp
@@ -69,8 +69,6 @@ bool CVkProto::RunCaptchaForm(LPCSTR szUrl, CMStringA &result)
bool CVkProto::ApplyCaptcha(AsyncHttpRequest *pReq, const JSONNode &jnErrorNode)
{
debugLogA("CVkProto::ApplyCaptcha");
-// if (!IsOnline())
-// return false;
CMStringA szUrl(jnErrorNode["captcha_img"].as_mstring());
CMStringA szSid(jnErrorNode["captcha_sid"].as_mstring());
@@ -82,7 +80,6 @@ bool CVkProto::ApplyCaptcha(AsyncHttpRequest *pReq, const JSONNode &jnErrorNode)
if (!RunCaptchaForm(szUrl, userReply))
return false;
-
CMStringA szCapthaStr(FORMAT, "&captcha_sid=%s&captcha_key=%s", mir_urlEncode(szSid).c_str(), mir_urlEncode(userReply.GetString()).c_str());
int iCaptchaBeg = pReq->m_szUrl.Find("&captcha_sid=", 0);