summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorPiotr Piastucki <leech.miranda@gmail.com>2015-10-31 10:41:07 +0000
committerPiotr Piastucki <leech.miranda@gmail.com>2015-10-31 10:41:07 +0000
commit47e0a9be59f5292a13af0a316ba4cda60ad3844a (patch)
tree9cc942c1392aaa2e9b0d4e17e52f1015deb29b55 /protocols
parent75d27e475943eafbcb52e9a795554358c9348fbd (diff)
- 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
Diffstat (limited to 'protocols')
-rw-r--r--protocols/MSN/src/msn_proto.h2
-rw-r--r--protocols/MSN/src/msn_soapab.cpp8
2 files changed, 8 insertions, 2 deletions
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<CMsnProto>
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;