diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-02-11 10:14:35 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-02-11 10:14:35 +0000 |
commit | e173a97cdc835e903d575de2b33fa95e9c94fa77 (patch) | |
tree | ac65f7d8c4b62747d58c6ce80afca73babc73c64 /protocols/VKontakte/src/vk_thread.cpp | |
parent | 85f31b137eb97138e81a185185882d445903f84d (diff) |
VKontakte:
add 2-Step Verification support
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@12087 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index a67b684c70..a99f131539 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -175,10 +175,13 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq pReq->m_pFunc = &CVkProto::OnOAuthAuthorize;
pReq->AddHeader("Referer", m_prevUrl);
pReq->Redirect(reply);
- if (pReq->m_szUrl) {
+ if (!pReq->m_szUrl.IsEmpty()) {
+ if (pReq->m_szUrl.GetBuffer()[0] == '/')
+ pReq->m_szUrl = "https://m.vk.com" + pReq->m_szUrl;
ApplyCookies(pReq);
m_prevUrl = pReq->m_szUrl;
}
+
Push(pReq);
}
}
@@ -211,7 +214,11 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq pReq->requestType = REQUEST_POST;
pReq->flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11;
pReq->m_szParam = szBody;
- pReq->m_szUrl = szAction; m_prevUrl = pReq->m_szUrl;
+ pReq->m_szUrl = szAction;
+ if (!pReq->m_szUrl.IsEmpty())
+ if (pReq->m_szUrl.GetBuffer()[0] == '/')
+ pReq->m_szUrl = "https://m.vk.com" + pReq->m_szUrl;
+ m_prevUrl = pReq->m_szUrl;
pReq->m_pFunc = &CVkProto::OnOAuthAuthorize;
pReq->AddHeader("Content-Type", "application/x-www-form-urlencoded");
pReq->Redirect(reply);
@@ -458,8 +465,8 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe LONG userID = getDword(hContact, "ID", -1);
if (userID == m_myUserId || userID == VK_FEED_USER)
continue;
- if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
- setWord(hContact, "Status", ID_STATUS_OFFLINE);
+ if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
SetMirVer(hContact, -1);
db_unset(hContact, m_szModuleName, "ListeningTo");
}
|