summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_proto.cpp
diff options
context:
space:
mode:
authorPiotr Piastucki <leech.miranda@gmail.com>2015-10-27 21:27:58 +0000
committerPiotr Piastucki <leech.miranda@gmail.com>2015-10-27 21:27:58 +0000
commit340386821c6b9e3c2e7b2cde0ec9e082efebcaec (patch)
tree42ff66fcf8cdbf76523fd7433cac738343e2c4d6 /protocols/MSN/src/msn_proto.cpp
parent239519030ec3cd6cf571ab79348596be0cb8eeeb (diff)
- 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
Diffstat (limited to 'protocols/MSN/src/msn_proto.cpp')
-rw-r--r--protocols/MSN/src/msn_proto.cpp19
1 files changed, 17 insertions, 2 deletions
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];