diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-05-28 10:09:40 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-05-28 10:09:40 +0000 |
commit | 7b2a41081e47ef013f53145ae5d7f6395ff26833 (patch) | |
tree | 21e5da55ec137a67b76252b47f63cf7b61613249 /protocols/VKontakte/src/vk_captcha.cpp | |
parent | 5f288f2ae11634f7470e6ab5c09f9625c12021c6 (diff) |
VKontakte:
rework code to JSONNode class
upgrade vk api to 5.33
code cleanup
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@13868 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_captcha.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_captcha.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/protocols/VKontakte/src/vk_captcha.cpp b/protocols/VKontakte/src/vk_captcha.cpp index 9c9de02d55..8064a3ea89 100644 --- a/protocols/VKontakte/src/vk_captcha.cpp +++ b/protocols/VKontakte/src/vk_captcha.cpp @@ -141,22 +141,23 @@ bool CVkProto::RunCaptchaForm(LPCSTR szUrl, CMStringA &result) /////////////////////////////////////////////////////////////////////////////////////////
// fill a request from JSON
-bool CVkProto::ApplyCaptcha(AsyncHttpRequest *pReq, JSONNODE *pErrorNode)
+bool CVkProto::ApplyCaptcha(AsyncHttpRequest *pReq, const JSONNode &jnErrorNode)
{
debugLogA("CVkProto::ApplyCaptcha");
if (!IsOnline())
return false;
- char *szUrl = NEWSTR_ALLOCA(_T2A(json_as_string(json_get(pErrorNode, "captcha_img"))));
- char *szSid = NEWSTR_ALLOCA(_T2A(json_as_string(json_get(pErrorNode, "captcha_sid"))));
- if (szUrl == NULL || szSid == NULL)
+ CMStringA szUrl(jnErrorNode["captcha_img"].as_mstring());
+ CMStringA szSid(jnErrorNode["captcha_sid"].as_mstring());
+
+ if (szUrl.IsEmpty() || szSid.IsEmpty())
return false;
CMStringA userReply;
- if (!RunCaptchaForm(szUrl, userReply))
+ if (!RunCaptchaForm(szUrl.GetBuffer(), userReply))
return false;
pReq << CHAR_PARAM("captcha_sid", szSid) << CHAR_PARAM("captcha_key", userReply.GetString());
pReq->bNeedsRestart = true;
return true;
-}
+}
\ No newline at end of file |