diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-18 17:05:35 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-18 17:05:35 +0000 |
commit | 16bc842255921eefcc0d1e6319230dc544c0cfa2 (patch) | |
tree | fcbbb4869807bf3ae933c0738d9472236187557a /protocols/SkypeWeb | |
parent | a99f03e44bf6de6fa134e861e12606c87d0eadc4 (diff) |
SkypeWeb: Login fix.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12915 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 18 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 1 |
2 files changed, 16 insertions, 3 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index d5f5ad9a7b..10a9899ad7 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -184,9 +184,12 @@ void CSkypeProto::OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response) return;
}
- ptrA skypename(getStringA(SKYPE_SETTINGS_ID));
- PushRequest(new SendCapabilitiesRequest(RegToken, EndpointId, Server));
- PushRequest(new SetStatusRequest(RegToken, MirandaToSkypeStatus(m_iDesiredStatus), Server), &CSkypeProto::OnStatusChanged);
+ PushRequest(new SendCapabilitiesRequest(RegToken, EndpointId, Server), &CSkypeProto::OnCapabilitiesSended);
+}
+
+void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response)
+{
+ SendRequest(new SetStatusRequest(RegToken, MirandaToSkypeStatus(m_iDesiredStatus), Server), &CSkypeProto::OnStatusChanged);
LIST<char> skypenames(1);
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
@@ -202,6 +205,15 @@ void CSkypeProto::OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response) if (getByte("AutoSync", 1))
SyncHistory();
+
+ if (response == NULL || response->pData == NULL)
+ return;
+ JSONROOT root(response->pData);
+ if (root == NULL)
+ return;
+
+ ptrA SelfEndpointName(SelfUrlToName(mir_t2a(ptrT(json_as_string(json_get(root, "SelfLink"))))));
+ setString("SelfEndpointName", SelfEndpointName);
}
void CSkypeProto::OnStatusChanged(const NETLIBHTTPREQUEST *response)
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 7fd4f368c8..0520bbd594 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -140,6 +140,7 @@ private: void OnLoginSuccess();
void OnEndpointCreated(const NETLIBHTTPREQUEST *response);
void OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response);
+ void OnCapabilitiesSended(const NETLIBHTTPREQUEST *response);
void OnStatusChanged(const NETLIBHTTPREQUEST *response);
// profile
|