diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-03 06:14:34 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-03 06:14:34 +0000 |
commit | 45cf5a88078cd23be4a4e0ccc569763dab4220b0 (patch) | |
tree | de0db275d63ea71d8d14698ea6d0332a466db35e /protocols/SkypeWeb/src/skype_polling.cpp | |
parent | 201ced87c58de8ee50cb15562506d700f51d09a1 (diff) |
incoming messages now work
git-svn-id: http://svn.miranda-ng.org/main/trunk@12583 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_polling.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_polling.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp index aed47be086..c9dda8f31a 100644 --- a/protocols/SkypeWeb/src/skype_polling.cpp +++ b/protocols/SkypeWeb/src/skype_polling.cpp @@ -1,11 +1,11 @@ -#include "common.h" - -#define POLLING_ERRORS_LIMIT 3 - -void CSkypeProto::ParsePollData(JSONNODE *data) -{ - debugLogA("CSkypeProto::ParsePollData"); - JSONNODE *node, *item = NULL; +#include "common.h"
+
+#define POLLING_ERRORS_LIMIT 3
+
+void CSkypeProto::ParsePollData(JSONNODE *data)
+{
+ debugLogA("CSkypeProto::ParsePollData");
+ JSONNODE *node, *item = NULL;
node = json_get(data, "eventMessages");
if (node != NULL)
{
@@ -40,54 +40,54 @@ void CSkypeProto::ParsePollData(JSONNODE *data) }
}
- } -} - -void CSkypeProto::PollingThread(void*) -{ - debugLog(_T("CSkypeProto::PollingThread: entering")); - - ptrA regToken(getStringA("registrationToken")); - const char *server = getStringA("Server"); - + }
+}
+
+void CSkypeProto::PollingThread(void*)
+{
+ debugLog(_T("CSkypeProto::PollingThread: entering"));
+
+ ptrA regToken(getStringA("registrationToken"));
+ const char *server = getStringA("Server");
+
SubscriptionsRequest *request = new SubscriptionsRequest(regToken, server);
request->Send(m_hNetlibUser);
- delete request; - - int errors = 0; - bool breaked = false; - while (!isTerminated && !breaked && errors < POLLING_ERRORS_LIMIT) - { - PollRequest *request = new PollRequest(regToken, server); - NETLIBHTTPREQUEST *response = request->Send(m_hNetlibUser); - delete request; - - if (response != NULL) - { - m_pollingConnection = response->nlc; - JSONROOT root(response->pData); + delete request;
+
+ int errors = 0;
+ bool breaked = false;
+ while (!isTerminated && !breaked && errors < POLLING_ERRORS_LIMIT)
+ {
+ PollRequest *request = new PollRequest(regToken, server);
+ NETLIBHTTPREQUEST *response = request->Send(m_hNetlibUser);
+ delete request;
+
+ if (response != NULL)
+ {
+ m_pollingConnection = response->nlc;
+ JSONROOT root(response->pData);
if (json_get(root, "errorCode") != NULL)
{
errors++;
continue;
- } - ParsePollData (root); - } - /*if (response->resultCode != 200) - { - errors++; - continue; - } - else - errors = 0;*/ - } - m_hPollingThread = NULL; - m_pollingConnection = NULL; - debugLog(_T("CSkypeProto::PollingThread: leaving")); - - if (!isTerminated) - { - debugLog(_T("CSkypeProto::PollingThread: unexpected termination; switching protocol to offline")); - SetStatus(ID_STATUS_OFFLINE); - } + }
+ ParsePollData (root);
+ }
+ /*if (response->resultCode != 200)
+ {
+ errors++;
+ continue;
+ }
+ else
+ errors = 0;*/
+ }
+ m_hPollingThread = NULL;
+ m_pollingConnection = NULL;
+ debugLog(_T("CSkypeProto::PollingThread: leaving"));
+
+ if (!isTerminated)
+ {
+ debugLog(_T("CSkypeProto::PollingThread: unexpected termination; switching protocol to offline"));
+ SetStatus(ID_STATUS_OFFLINE);
+ }
}
\ No newline at end of file |