summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_polling.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-04-03 05:33:18 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-04-03 05:33:18 +0000
commita50ae784ce7394b2621cf42a28cab7edd31e6c6a (patch)
treed32d2925947e77442d364c1849adfd54bb896276 /protocols/SkypeWeb/src/skype_polling.cpp
parent2e511ab1b1ff3d78c695874e3b28ff4ce7680cc8 (diff)
login fix and some other fixes (patch by MikalaiR)
git-svn-id: http://svn.miranda-ng.org/main/trunk@12581 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_polling.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_polling.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp
index 8dc73280a7..aed47be086 100644
--- a/protocols/SkypeWeb/src/skype_polling.cpp
+++ b/protocols/SkypeWeb/src/skype_polling.cpp
@@ -20,7 +20,7 @@ void CSkypeProto::ParsePollData(JSONNODE *data)
if (!mir_tstrcmpi(resourceType, L"NewMessage"))
{
- continue;
+ ProcessNewMessageRes(resource);
}
else if (!mir_tstrcmpi(resourceType, L"UserPresence"))
{
@@ -28,7 +28,7 @@ void CSkypeProto::ParsePollData(JSONNODE *data)
}
else if (!mir_tstrcmpi(resourceType, L"EndpointPresence"))
{
- continue;
+ ProcessEndpointPresenceRes(resource);
}
else if (!mir_tstrcmpi(resourceType, L"ConversationUpdate"))
{
@@ -40,8 +40,7 @@ void CSkypeProto::ParsePollData(JSONNODE *data)
}
}
- }
-
+ }
}
void CSkypeProto::PollingThread(void*)
@@ -49,18 +48,29 @@ 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);
+ 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)
@@ -72,6 +82,7 @@ void CSkypeProto::PollingThread(void*)
errors = 0;*/
}
m_hPollingThread = NULL;
+ m_pollingConnection = NULL;
debugLog(_T("CSkypeProto::PollingThread: leaving"));
if (!isTerminated)