diff options
Diffstat (limited to 'protocols/SkypeWeb/src/skype_oauth.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_oauth.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/src/skype_oauth.cpp b/protocols/SkypeWeb/src/skype_oauth.cpp index 26d61e3ad9..e15578a571 100644 --- a/protocols/SkypeWeb/src/skype_oauth.cpp +++ b/protocols/SkypeWeb/src/skype_oauth.cpp @@ -27,7 +27,6 @@ void CSkypeProto::OnOAuthStart(NETLIBHTTPREQUEST *response, AsyncHttpRequest*) std::regex regex; std::smatch match; - std::map<std::string, std::string> scookies; std::string content = response->pData; regex = "<input.+?type=\"hidden\".+?name=\"PPFT\".+?id=\"i0327\".+?value=\"(.+?)\".*?/>"; @@ -39,6 +38,7 @@ void CSkypeProto::OnOAuthStart(NETLIBHTTPREQUEST *response, AsyncHttpRequest*) } std::string PPTF = match[1]; + std::map<std::string, std::string> scookies; for (int i = 0; i < response->headersCount; i++) { if (mir_strcmpi(response->headers[i].szName, "Set-Cookie")) continue; @@ -85,26 +85,24 @@ void CSkypeProto::OnOAuthConfirm(NETLIBHTTPREQUEST *response, AsyncHttpRequest * std::regex regex; std::smatch match; std::string content = response->pData; - std::map<std::string, std::string> scookies; - std::string PPTF; - std::string opid; - regex = "sFT:'(.+?)'"; + regex = "<input.+?type=\"hidden\".+?name=\"PPFT\".+?id=\"i0327\".+?value=\"(.+?)\".*?/>";; if (!std::regex_search(content, match, regex)) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); SetStatus(ID_STATUS_OFFLINE); return; } - PPTF = match[1]; + std::string PPTF = match[1]; - regex = "&opid=(.+?)'"; + regex = "[&?]opid=(.+?)[&']"; if (!std::regex_search(content, match, regex)) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); SetStatus(ID_STATUS_OFFLINE); return; } - opid = match[1]; + std::string opid = match[1]; + std::map<std::string, std::string> scookies; for (int i = 0; i < response->headersCount; i++) { if (mir_strcmpi(response->headers[i].szName, "Set-Cookie")) continue; |