summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_oauth.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-12-19 21:11:32 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-12-19 21:11:32 +0300
commit38d2ffd33244be6145976c7a30b87fa6fabc565d (patch)
treee2bd8d937c2e802257867b2e2245d75708b327ef /protocols/SkypeWeb/src/skype_oauth.cpp
parente1ce8dafa01406edc8b2e3540c3f7a4ae3bdfadd (diff)
fixes #4810 (Skype: Will not login)
Diffstat (limited to 'protocols/SkypeWeb/src/skype_oauth.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_oauth.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/protocols/SkypeWeb/src/skype_oauth.cpp b/protocols/SkypeWeb/src/skype_oauth.cpp
index 1a8efc2447..5f35dba385 100644
--- a/protocols/SkypeWeb/src/skype_oauth.cpp
+++ b/protocols/SkypeWeb/src/skype_oauth.cpp
@@ -63,11 +63,7 @@ void CSkypeProto::OnOAuthStart(MHttpResponse *response, AsyncHttpRequest*)
ptrA login(getStringA(SKYPE_SETTINGS_ID));
ptrA password(getStringA(SKYPE_SETTINGS_PASSWORD));
- CMStringA mscookies(FORMAT, "MSPRequ=%s;MSPOK=%s;CkTst=G%lld;", scookies["MSPRequ"].c_str(), scookies["MSPOK"].c_str(), time(NULL));
-
- cookies["MSPRequ"] = scookies["MSPRequ"];
-
- PushRequest(new OAuthRequest(login, password, mscookies.c_str(), PPFT.c_str()));
+ PushRequest(new OAuthRequest(login, password, response->GetCookies().c_str(), PPFT.c_str()));
}
bool CSkypeProto::CheckOauth(const char *szResponse)
@@ -103,20 +99,7 @@ void CSkypeProto::OnOAuthConfirm(MHttpResponse *response, AsyncHttpRequest *)
return;
}
- std::regex regex("^(.+?=.*?;)");
- std::smatch match;
- CMStringA mscookies;
-
- for (auto &it : *response) {
- if (mir_strcmpi(it->szName, "Set-Cookie"))
- continue;
-
- content = it->szValue;
- if (std::regex_search(content, match, regex))
- mscookies.Append(match[1].str().c_str());
- }
-
- PushRequest(new OAuthRequest(mscookies.c_str(), PPFT.c_str(), opid.c_str()));
+ PushRequest(new OAuthRequest(response->GetCookies(), PPFT.c_str(), opid.c_str()));
}
void CSkypeProto::OnOAuthAuthorize(MHttpResponse *response, AsyncHttpRequest*)