From 1dd4c9316543ff292ce250f7f08b25385fc8e37a Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 7 Jun 2015 11:57:31 +0000 Subject: SkypeWeb: MS login fix. git-svn-id: http://svn.miranda-ng.org/main/trunk@14047 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_mslogin.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'protocols/SkypeWeb/src/skype_mslogin.cpp') 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 = ""; + + 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); } -- cgit v1.2.3