From 47e0a9be59f5292a13af0a316ba4cda60ad3844a Mon Sep 17 00:00:00 2001 From: Piotr Piastucki Date: Sat, 31 Oct 2015 10:41:07 +0000 Subject: - MSN: Expiremental, untested code that should issue a relogin if WLSSC Cookie on abcore call expired and refresh of WLSSC is needed. Of course this requirement makes token refresh pretty useless, as relogin is required even though tokens may still be valid, but there currently is no other solution to fetch contact list including Skype contacts. git-svn-id: http://svn.miranda-ng.org/main/trunk@15655 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/src/msn_proto.h | 2 +- protocols/MSN/src/msn_soapab.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'protocols/MSN') diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index 2bc9a24bff..48d793a770 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -563,7 +563,7 @@ struct CMsnProto : public PROTO bool MSN_ABAddRemoveContact(const char* szCntId, int netId, bool add, bool allowRecurse = true); unsigned MSN_ABContactAdd(const char* szEmail, const char* szNick, int netId, const char* szInvite, bool search, bool retry = false, bool allowRecurse = true); void MSN_ABUpdateDynamicItem(bool allowRecurse = true); - bool MSN_ABRefreshClist(void); + bool MSN_ABRefreshClist(unsigned int nTry=0); ezxml_t abSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr); char* GetABHost(const char* service, bool isSharing); diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp index e0cd772cad..be9c914710 100644 --- a/protocols/MSN/src/msn_soapab.cpp +++ b/protocols/MSN/src/msn_soapab.cpp @@ -839,7 +839,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas return status == 200; } -bool CMsnProto::MSN_ABRefreshClist(void) +bool CMsnProto::MSN_ABRefreshClist(unsigned int nTry) { NETLIBHTTPREQUEST nlhr = { 0 }; NETLIBHTTPHEADER headers[2]; @@ -939,6 +939,12 @@ bool CMsnProto::MSN_ABRefreshClist(void) } ezxml_free(xmlm); } + } else if (nlhrReply->resultCode == 400 && !nTry) { + // FIXME: No idea how to properly refresh WLSSC cookie required, therefore + // complete relogin :( For this we nuke auth token so that relogin is encforeced + // until we have a better solution + authSkypeComToken.Clear(); + if (MSN_AuthOAuth() > 0) return MSN_ABRefreshClist(1); } CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)nlhrReply); } else hHttpsConnection = NULL; -- cgit v1.2.3