summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2016-08-08 05:28:08 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2016-08-08 05:28:08 +0000
commit212d36e4fd71b88a427ecbc8e3c3536daf88de38 (patch)
treef3edc67100ad12cce67c560f604c971784990612 /protocols/VKontakte/src/misc.cpp
parente53d2bd66b1b0bebcc355c165c1060a4490f01ab (diff)
VKontakte:
fixed processing for ‘validation required’ error change MessageBox -> MessageBoxW change styles for some MessageBoxW git-svn-id: http://svn.miranda-ng.org/main/trunk@17166 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 4bbb24b730..d4ac98f3c7 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -413,12 +413,24 @@ bool CVkProto::AutoFillForm(char *pBody, CMStringA &szAction, CMStringA& szResul
value = (char*)T2Utf(ptrW(GetUserStoredPassword()));
else if (name == "captcha_key") {
char *pCaptchaBeg = strstr(pFormBeg, "<img id=\"captcha\"");
- if (pCaptchaBeg != NULL)
+ if (pCaptchaBeg)
if (!RunCaptchaForm(getAttr(pCaptchaBeg, "src"), value))
return false;
}
- else if (name == "code")
- value = RunConfirmationCode();
+ else if (name == "code") {
+ char szPrefixTel[10], szSufixTel[10];
+ CMStringW wszTitle;
+ char *pPhonePref = strstr(pFormBeg, "<span class=\"field_prefix\">");
+ if (pPhonePref && sscanf(pPhonePref, "<span class=\"field_prefix\">%s</span>", szPrefixTel) == 1) {
+ pPhonePref = strstr(pPhonePref + 1, "<span class=\"field_prefix\">&nbsp;");
+ if (pPhonePref && sscanf(pPhonePref, "<span class=\"field_prefix\">&nbsp;%s</span>", szSufixTel) == 1) {
+ wszTitle.Format(L"%s %s %s %s %s", TranslateT("Enter the missing digits between"), ptrW(mir_a2u(szPrefixTel)), TranslateT("and"), ptrW(mir_a2u(szSufixTel)), TranslateT("of the phone number linked to your account"));
+ MessageBoxW(NULL, wszTitle, TranslateT("Attention!"), MB_ICONWARNING | MB_OK);
+ }
+ }
+
+ value = RunConfirmationCode(wszTitle);
+ }
if (!result.IsEmpty())
result.AppendChar('&');
@@ -432,11 +444,12 @@ bool CVkProto::AutoFillForm(char *pBody, CMStringA &szAction, CMStringA& szResul
return true;
}
-CMStringW CVkProto::RunConfirmationCode()
+CMStringW CVkProto::RunConfirmationCode(LPCWSTR pwszTitle)
{
ENTER_STRING pForm = { sizeof(pForm) };
- pForm.type = ESF_PASSWORD;
- pForm.caption = TranslateT("Enter confirmation code");
+ pForm.type = ESF_COMBO;
+ pForm.recentCount = 0;
+ pForm.caption = IsEmpty(pwszTitle) ? TranslateT("Enter confirmation code") : pwszTitle;
pForm.ptszInitVal = NULL;
pForm.szModuleName = m_szModuleName;
pForm.szDataPrefix = "confirmcode_";