From f9475db573dcf34f9b8ea8180b69c834978f6ac9 Mon Sep 17 00:00:00 2001 From: Piotr Piastucki Date: Thu, 14 May 2015 17:49:05 +0000 Subject: Fixed web authentication method without SkyLib. git-svn-id: http://svn.miranda-ng.org/main/trunk@13592 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/src/msn_auth.cpp | 6 ++++++ protocols/MSN/src/msn_commands.cpp | 30 ++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) (limited to 'protocols/MSN/src') diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index c91be0edb1..cfb1e5291a 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -670,6 +670,10 @@ void CMsnProto::LoadAuthTokensDB(void) replaceStr(authCookies, dbv.pszVal); db_free(&dbv); } + if (getString("authStrToken", &dbv) == 0) { + replaceStr(authStrToken, dbv.pszVal); + db_free(&dbv); + } } void CMsnProto::SaveAuthTokensDB(void) @@ -681,6 +685,7 @@ void CMsnProto::SaveAuthTokensDB(void) setString("authContactToken", authContactToken); setString("authUIC", authUIC); setString("authCookies", authCookies); + setString("authStrToken", authStrToken); } // -1 - Error on login sequence @@ -852,6 +857,7 @@ int CMsnProto::MSN_AuthOAuth(void) pMappingContainer+=20; UrlDecode(pMappingContainer); replaceStr(authUIC, pMappingContainer); + MSN_GetPassportAuth(); authMethod = retVal = 2; } else retVal = 0; } else retVal = 0; diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 3c45f5d98d..6b9d3e3b2d 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -1367,24 +1367,34 @@ LBL_InvalidCommand: if (GetMyNetID()!=NETID_SKYPE) { /* MSN account login */ - char *pszSite = ""; switch (MSN_AuthOAuth()) { - case 1: break; - case 2: pszSite = "chatservice.live.com"; break; + case 1: + info->sendPacketPayload("ATH", "CON\\USER", + "t=%s" + "%s" + "%s%s\r\n", + authSSLToken ? ptrA(HtmlEncode(authSSLToken)) : "", + authUIC, + GetMyUsername(NETID_MSN), GetMyUsername(NETID_SKYPE)); + break; + + case 2: + info->sendPacketPayload("ATH", "CON\\USER", + "%s" + "%s" + "chatservice.live.com" + "\r\n", + authStrToken ? ptrA(HtmlEncode(authStrToken)) : "", + authUIC); + break; + default: m_iDesiredStatus = ID_STATUS_OFFLINE; return 1; } - info->sendPacketPayload("ATH", "CON\\USER", - "t=%s" - "%s%s" - "%s%s\r\n", - authSSLToken ? ptrA(HtmlEncode(authSSLToken)) : "", - authUIC, pszSite, - GetMyUsername(NETID_MSN), GetMyUsername(NETID_SKYPE)); } else { /* Skype username/pass login */ ezxml_t xmlcnt = ezxml_parse_str(msgBody, strlen(msgBody)); -- cgit v1.2.3