summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-25 16:57:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-25 16:57:18 +0000
commitd2a51dc68f19b260883a9f35b6e150f08c01f63d (patch)
tree498a8c7b6afd90d49e7c85eed501da0039e8dfcd /protocols
parent4007fd83daf5be1b0a8d9bc5a9a3f5dfff4323c3 (diff)
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
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/misc.cpp14
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk_options.cpp2
-rw-r--r--protocols/VKontakte/src/vk_proto.h4
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp6
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, "<form ");
- if (pFormBeg == NULL) return "";
+ if (pFormBeg == NULL) return false;
char *pFormEnd = strstr(pFormBeg, "</form>");
- 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, "<img id=\"captcha\"");
if (pCaptchaBeg != NULL)
- RunCaptchaForm( getAttr(pCaptchaBeg, "src"), value);
+ if ( !RunCaptchaForm( getAttr(pCaptchaBeg, "src"), value))
+ return false;
}
if ( !result.IsEmpty())
@@ -203,7 +206,8 @@ CMStringA CVkProto::AutoFillForm(char *pBody, CMStringA &szAction)
}
}
- return result;
+ szResult = result;
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index f0c3ac76f1..e6a040d582 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 0
-#define __BUILD_NUM 4
+#define __BUILD_NUM 5
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp
index 1027af3508..c8d7ed7796 100644
--- a/protocols/VKontakte/src/vk_options.cpp
+++ b/protocols/VKontakte/src/vk_options.cpp
@@ -33,8 +33,6 @@ INT_PTR CALLBACK VKAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->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;