diff options
| -rw-r--r-- | protocols/VKontakte/src/misc.cpp | 14 | ||||
| -rw-r--r-- | protocols/VKontakte/src/vk_captcha.cpp | 12 | ||||
| -rw-r--r-- | protocols/VKontakte/src/vk_queue.cpp | 4 |
3 files changed, 24 insertions, 6 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 9a805a5f52..95870c2a7a 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -492,7 +492,6 @@ CMStringW CVkProto::RunRenameNick(LPCWSTR pwszOldName) void CVkProto::GrabCookies(MHttpResponse *nhr, CMStringA szDefDomain)
{
- debugLogA("CVkProto::GrabCookies");
if (!nhr)
return;
@@ -501,6 +500,12 @@ void CVkProto::GrabCookies(MHttpResponse *nhr, CMStringA szDefDomain) continue;
CMStringA szValue = hdr->szValue, szCookieName, szCookieVal, szDomain;
+
+ CMStringA szLogValue(szValue);
+ if (!IsEmpty(m_szAccessToken))
+ szLogValue.Replace(m_szAccessToken, "*secret*");
+ debugLogA("CVkProto::GrabCookies: %s", szLogValue.c_str());
+
int iStart = 0;
while (true) {
bool bFirstToken = (iStart == 0);
@@ -534,6 +539,7 @@ void CVkProto::GrabCookies(MHttpResponse *nhr, CMStringA szDefDomain) if (!bFound && CMStringA(szCookieVal).MakeUpper() != "DELETED")
m_cookies.insert(new CVkCookie(szCookieName, szCookieVal, szDomain));
+
}
}
@@ -563,7 +569,6 @@ void CVkProto::ApplyCookies(MHttpRequest *pReq) void CVkProto::SaveCookies()
{
- debugLogA("CVkProto::SaveCookies");
CMStringA szCookie;
for (auto& it : m_cookies) {
@@ -578,6 +583,11 @@ void CVkProto::SaveCookies() if (!szCookie.IsEmpty())
setString("Cookie", szCookie);
+
+ if (!IsEmpty(m_szAccessToken))
+ szCookie.Replace(m_szAccessToken, "*secret*");
+
+ debugLogA("CVkProto::SaveCookies: %s", szCookie.c_str());
}
void CVkProto::LoadCookies()
diff --git a/protocols/VKontakte/src/vk_captcha.cpp b/protocols/VKontakte/src/vk_captcha.cpp index 90b4db548e..58d212fd8c 100644 --- a/protocols/VKontakte/src/vk_captcha.cpp +++ b/protocols/VKontakte/src/vk_captcha.cpp @@ -88,9 +88,15 @@ bool CVkProto::ApplyCaptcha(AsyncHttpRequest *pReq, const JSONNode &jnErrorNode) return false;
}
- Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOnline.json", true, &CVkProto::OnReceiveSmth, AsyncHttpRequest::rpCaptcha)
- << CHAR_PARAM("captcha_sid", szSid)
- << CHAR_PARAM("captcha_key", userReply.GetString())
+ Push(new AsyncHttpRequest(this,
+ REQUEST_GET,
+ (m_iStatus == ID_STATUS_INVISIBLE) ? "/method/account.setOffline" : "/method/account.setOnline",
+ true,
+ &CVkProto::OnReceiveSmth,
+ AsyncHttpRequest::rpCaptcha
+ )
+ << CHAR_PARAM("captcha_sid", szSid)
+ << CHAR_PARAM("captcha_key", userReply.GetString())
);
pReq->bNeedsRestart = true;
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp index 13a4556a51..6e71d6b8fc 100644 --- a/protocols/VKontakte/src/vk_queue.cpp +++ b/protocols/VKontakte/src/vk_queue.cpp @@ -56,8 +56,10 @@ bool CVkProto::ExecuteRequest(AsyncHttpRequest *pReq) }
CMStringA szParam(pReq->m_szParam);
- szParam.Replace(m_szAccessToken, "*secret*");
+ if (!IsEmpty(m_szAccessToken))
+ szParam.Replace(m_szAccessToken, "*secret*");
debugLogA("CVkProto::ExecuteRequest \n====\n%s\n%s\n====\n", pReq->m_szUrl.c_str(), szParam.c_str());
+
NLHR_PTR reply(Netlib_HttpTransaction(m_hNetlibUser, pReq));
{
mir_cslock lck(m_csWorkThreadTimer);
|
