summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_polling.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/skype_polling.cpp')
-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;
}