summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-02-04 16:44:47 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-02-04 16:44:47 +0300
commit675143ed0e670237e5561ae5362d48fc173d30dd (patch)
tree23a16311f42be4f4148ddb8cbd4c7043bc7f8f48
parentc37b528af0f34ac897a17275c6a98ab43d1541a2 (diff)
minor code cleaning
-rw-r--r--protocols/SkypeWeb/src/skype_oauth.cpp14
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;