From d2a51dc68f19b260883a9f35b6e150f08c01f63d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 25 Oct 2013 16:57:18 +0000 Subject: VK: - stupid password length limitation of 30 chars removed (thanks emx for pointing me to); - cancel in captcha form now stops the login process. git-svn-id: http://svn.miranda-ng.org/main/trunk@6626 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 14 +++++++++----- protocols/VKontakte/src/version.h | 2 +- protocols/VKontakte/src/vk_options.cpp | 2 -- protocols/VKontakte/src/vk_proto.h | 4 ++-- protocols/VKontakte/src/vk_thread.cpp | 6 +++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index f4c2a86439..c412e3ca5c 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -164,13 +164,15 @@ LBL_NotFound: return CMStringA(p1, (int)(p2-p1)); } -CMStringA CVkProto::AutoFillForm(char *pBody, CMStringA &szAction) +bool CVkProto::AutoFillForm(char *pBody, CMStringA &szAction, CMStringA& szResult) { + szResult.Empty(); + char *pFormBeg = strstr(pBody, "
"); - if (pFormEnd == NULL) return ""; + if (pFormEnd == NULL) return false; *pFormEnd = 0; @@ -193,7 +195,8 @@ CMStringA CVkProto::AutoFillForm(char *pBody, CMStringA &szAction) else if (name == "captcha_key") { char *pCaptchaBeg = strstr(pFormBeg, "m_hProtoIcon, true)); SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon)); - - SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_LIMITTEXT, 30, 0); { ptrT tszLogin( ppro->getTStringA("Login")); if (tszLogin != NULL) diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 1c2582ccaa..1f00a1f0d9 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -159,8 +159,8 @@ private: bool PushAsyncHttpRequest(AsyncHttpRequest*, int iTimeout = 10000); void __cdecl WorkerThread(void*); - bool RunCaptchaForm(LPCSTR szUrl, CMStringA&); - CMStringA AutoFillForm(char*, CMStringA&); + bool RunCaptchaForm(LPCSTR szUrl, CMStringA&); + bool AutoFillForm(char*, CMStringA&, CMStringA&); bool CheckJsonResult(AsyncHttpRequest *pReq, NETLIBHTTPREQUEST *reply, JSONNODE*); JSONNODE* CheckJsonResponse(AsyncHttpRequest *pReq, NETLIBHTTPREQUEST *reply, JSONROOT&); diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 78b078bd08..ec26804c2c 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -155,9 +155,9 @@ LBL_NoForm: if ( !strstr(reply->pData, "form method=\"post\"")) goto LBL_NoForm; - CMStringA szAction; - CMStringA szBody = AutoFillForm(reply->pData, szAction); - if (szAction.IsEmpty() || szBody.IsEmpty()) { + CMStringA szAction, szBody; + bool bSuccess = AutoFillForm(reply->pData, szAction, szBody); + if (!bSuccess || szAction.IsEmpty() || szBody.IsEmpty()) { if (m_prevError) goto LBL_NoForm; m_prevError = true; -- cgit v1.2.3