From b7a6c7fa596253de69a3b0cac9255801f4842cf2 Mon Sep 17 00:00:00 2001 From: NightFox <0x4E69676874466F78@users.noreply.github.com> Date: Fri, 12 Jul 2019 00:05:40 +0300 Subject: Improvement logic regular expressions for skype_mslogin.cpp Immunity to extraneous classes, attributes, spaces But the best way is to use a good html parser --- protocols/SkypeWeb/src/skype_mslogin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/SkypeWeb/src') diff --git a/protocols/SkypeWeb/src/skype_mslogin.cpp b/protocols/SkypeWeb/src/skype_mslogin.cpp index 1da26f16f0..84755dad3a 100644 --- a/protocols/SkypeWeb/src/skype_mslogin.cpp +++ b/protocols/SkypeWeb/src/skype_mslogin.cpp @@ -30,7 +30,7 @@ void CSkypeProto::OnMSLoginFirst(const NETLIBHTTPREQUEST *response) std::map scookies; std::string content = response->pData; - regex = ""; + regex = ""; if (!std::regex_search(content, match, regex)) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); @@ -67,7 +67,7 @@ void CSkypeProto::OnMSLoginSecond(const NETLIBHTTPREQUEST *response) std::string content = response->pData; ptrA szContent(response->pData); - regex = ""; + regex = ""; if (std::regex_search(content, match, regex)) { if (match[1] == "i5600") { CMStringA szCookies; @@ -93,7 +93,7 @@ void CSkypeProto::OnMSLoginSecond(const NETLIBHTTPREQUEST *response) } } - regex = ""; + regex = ""; if (!std::regex_search(content, match, regex)) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); SetStatus(ID_STATUS_OFFLINE); @@ -116,7 +116,7 @@ void CSkypeProto::OnMSLoginThird(const NETLIBHTTPREQUEST *response) std::smatch match; std::string content = response->pData; - regex = ""; + regex = ""; if (!std::regex_search(content, match, regex)) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); @@ -140,7 +140,7 @@ void CSkypeProto::OnMSLoginEnd(const NETLIBHTTPREQUEST *response) std::smatch match; std::string content = response->pData; - regex = ""; + regex = ""; if (!std::regex_search(content, match, regex)) { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); SetStatus(ID_STATUS_OFFLINE); @@ -148,7 +148,7 @@ void CSkypeProto::OnMSLoginEnd(const NETLIBHTTPREQUEST *response) } std::string token = match[1]; setString("TokenSecret", token.c_str()); - regex = ""; + regex = ""; if (std::regex_search(content, match, regex)) { std::string expiresIn = match[1]; -- cgit v1.2.3