summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-04-28 14:55:20 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-04-28 14:55:20 +0000
commit6bd7ca89447e90524cbd9c5c18d0f7c5e39101d6 (patch)
treeae7e678bf90cede4f10aa2500e3e11757dade515 /protocols/SkypeWeb/src
parent5d45f1a869d63df95cd46c3e1dbb3d8d684565d7 (diff)
SkypeWeb: Small polling refactoring.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13228 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r--protocols/SkypeWeb/src/skype_polling.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp
index 3ebfa13661..caa14eaa0c 100644
--- a/protocols/SkypeWeb/src/skype_polling.cpp
+++ b/protocols/SkypeWeb/src/skype_polling.cpp
@@ -83,17 +83,27 @@ void CSkypeProto::PollingThread(void*)
if (response->pData)
{
JSONROOT root(response->pData);
- JSONNODE *errorCode = json_get(root, "errorCode");
- if (errorCode != NULL)
+ JSONNODE *eventMsgs = json_get(root, "eventMessages");
+ JSONNODE *errorCode = json_get(root, "errorCode");
+
+ if (eventMsgs != NULL)
+ ParsePollData(root);
+
+ else if (errorCode != NULL)
{
errors++;
- debugLogA(__FUNCTION__": polling error %s", ptrA(mir_t2a(ptrT(json_as_string(errorCode)))));
+ debugLogA(__FUNCTION__": polling error %d", json_as_int(errorCode));
+ if (json_as_int(errorCode) == 729)
+ {
+ SendRequest(new CreateEndpointRequest(TokenSecret), &CSkypeProto::OnEndpointCreated);
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)response);
+ delete request;
+ break;
+ }
}
- ParsePollData(root);
}
m_pollingConnection = response->nlc;
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)response);
-
delete request;
}