diff options
-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
|