diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-24 13:35:19 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-24 13:35:19 +0000 |
commit | 05b9e876bcbda86441b52d528b6875a7d211e734 (patch) | |
tree | 8a3bcd9d664b523589576c1cf1204753f8af4ee3 /protocols/SkypeWeb/src/skype_login.cpp | |
parent | 9ea1fabf1643f117b46ee44d359084fe77bfd4f2 (diff) |
SkypeWeb: More fixes.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14676 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_login.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 54879eb61a..c4a5601aae 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -235,6 +235,13 @@ void CSkypeProto::SendPresence(bool isLogin) void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response)
{
+ if (response == NULL || response->pData == NULL)
+ {
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
+ SetStatus(ID_STATUS_OFFLINE);
+ return;
+ }
+
SendRequest(new SetStatusRequest(m_szRegToken, MirandaToSkypeStatus(m_iDesiredStatus), m_szServer), &CSkypeProto::OnStatusChanged);
LIST<char> skypenames(1);
@@ -248,6 +255,7 @@ void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) mir_free(skypenames[i]);
skypenames.destroy();
+
m_hPollingThread = ForkThreadEx(&CSkypeProto::PollingThread, 0, NULL);
PushRequest(new GetAvatarRequest(ptrA(getStringA("AvatarUrl"))), &CSkypeProto::OnReceiveAvatar, NULL);
@@ -257,9 +265,6 @@ void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) if (getBool("AutoSync", true))
PushRequest(new SyncHistoryFirstRequest(m_szRegToken, 100, m_szServer), &CSkypeProto::OnSyncHistory);
- if (response == NULL || response->pData == NULL)
- return;
-
JSONNode root = JSONNode::parse(response->pData);
if (root)
setString("SelfEndpointName", SelfUrlToName(root["selfLink"].as_string().c_str()));
@@ -267,7 +272,7 @@ void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) void CSkypeProto::OnStatusChanged(const NETLIBHTTPREQUEST *response)
{
- if (response == NULL)
+ if (response == NULL || response->pData == NULL)
{
debugLogA(__FUNCTION__ ": failed to change status");
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
|