From 340386821c6b9e3c2e7b2cde0ec9e082efebcaec Mon Sep 17 00:00:00 2001 From: Piotr Piastucki Date: Tue, 27 Oct 2015 21:27:58 +0000 Subject: - MSN: Managing and refreshing OAuth tokens with different expiration times. git-svn-id: http://svn.miranda-ng.org/main/trunk@15627 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/src/msn_proto.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'protocols/MSN/src/msn_proto.cpp') diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 762a79f40c..9d1f2b5a31 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -45,13 +45,28 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : #endif lsMessageQueue(1), lsAvatarQueue(1), - msgCache(5, CompareId) + msgCache(5, CompareId), + authContactToken("authContact", "service::contacts.msn.com::MBI_SSL"), + authStorageToken("authStorage", "service::storage.msn.com::MBI_SSL"), + authSSLToken("authSSL", "service::ssl.live.com::MBI_SSL"), + authSkypeComToken("authSkypeCom", "service::skype.com::MBI_SSL"), + authStrToken("authStr", "service::chatservice.live.com::MBI_SSL", true), + authSkypeToken("authSkype") { db_set_resident(m_szModuleName, "IdleTS"); db_set_resident(m_szModuleName, "p2pMsgId"); db_set_resident(m_szModuleName, "MobileEnabled"); db_set_resident(m_szModuleName, "MobileAllowed"); + // Initialize tokens + authContactToken.Init(this); + authStorageToken.Init(this); + authSSLToken.Init(this); + authSkypeComToken.Init(this); + authStrToken.Init(this); + authSkypeToken.Init(this); + LoadAuthTokensDB(); + // Protocol services and events... CreateProtoService(PS_CREATEACCMGRUI, &CMsnProto::SvcCreateAccMgrUI); @@ -517,7 +532,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) if (ft->tType == SERVER_HTTP) { const char *pszSkypeToken; - if (ft->fileId != -1 && (pszSkypeToken=GetSkypeToken(true))) { + if (ft->fileId != -1 && (pszSkypeToken=authSkypeToken.Token())) { NETLIBHTTPHEADER nlbhHeaders[3] = { 0 }; NETLIBHTTPREQUEST nlhr = { 0 }, *nlhrReply; char szRange[32]; -- cgit v1.2.3