From 38d2ffd33244be6145976c7a30b87fa6fabc565d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 19 Dec 2024 21:11:32 +0300 Subject: fixes #4810 (Skype: Will not login) --- protocols/SkypeWeb/src/skype_oauth.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_oauth.cpp') 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*) -- cgit v1.2.3