diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-06-07 11:57:31 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-06-07 11:57:31 +0000 |
commit | 1dd4c9316543ff292ce250f7f08b25385fc8e37a (patch) | |
tree | 346ec117a056d7a5140e3447a87fac656f4ae0ad /protocols/SkypeWeb/src/skype_mslogin.cpp | |
parent | c0f9a5967f49773d7a3784252ea6912929f469ae (diff) |
SkypeWeb: MS login fix.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14047 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_mslogin.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_mslogin.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/skype_mslogin.cpp b/protocols/SkypeWeb/src/skype_mslogin.cpp index 0ead57b1fd..637876f1e9 100644 --- a/protocols/SkypeWeb/src/skype_mslogin.cpp +++ b/protocols/SkypeWeb/src/skype_mslogin.cpp @@ -111,6 +111,32 @@ void CSkypeProto::OnMSLoginSecond(const NETLIBHTTPREQUEST *response) }
std::string t = match[1];
+ SendRequest(new LoginMSRequest(t.c_str(), 0), &CSkypeProto::OnMSLoginThird);
+}
+
+void CSkypeProto::OnMSLoginThird(const NETLIBHTTPREQUEST *response)
+{
+ if (response == NULL || response->pData == NULL)
+ {
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
+ SetStatus(ID_STATUS_OFFLINE);
+ return;
+ }
+
+ std::regex regex;
+ std::smatch match;
+ std::string content = response->pData;
+
+ regex = "<input type=\"hidden\" name=\"t\" value=\"(.+?)\">";
+
+ if (!std::regex_search(content, match, regex))
+ {
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
+ SetStatus(ID_STATUS_OFFLINE);
+ return;
+ }
+ std::string t = match[1];
+
SendRequest(new LoginMSRequest(t.c_str()), &CSkypeProto::OnMSLoginEnd);
}
|