diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-04-07 21:50:05 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-04-07 21:50:05 +0000 |
commit | 90a05404a6ded56141c0230f663686439f8fa146 (patch) | |
tree | 6531783fbbedc04db025526243342823ed9ccd65 /protocols/SkypeWeb/src/skype_polling.cpp | |
parent | de593c8e4ae504a8d159cc272740846ef9c20ca6 (diff) |
SkypeWeb:
- added ability to getting contacts statuses
- partly reworked login flow
git-svn-id: http://svn.miranda-ng.org/main/trunk@12665 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_polling.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_polling.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp index ad882e10a9..fb2ea0fd7b 100644 --- a/protocols/SkypeWeb/src/skype_polling.cpp +++ b/protocols/SkypeWeb/src/skype_polling.cpp @@ -47,28 +47,27 @@ void CSkypeProto::PollingThread(void*) ptrA regToken(getStringA("registrationToken"));
ptrA server(getStringA("Server"));
- SubscriptionsRequest *request = new SubscriptionsRequest(regToken, server);
- request->Send(m_hNetlibUser);
- delete request;
-
int errors = 0;
bool breaked = false;
+ isTerminated = false;
while (!isTerminated && !breaked && errors < POLLING_ERRORS_LIMIT)
{
- PollRequest *request = new PollRequest(regToken, server);
+ PollRequest *request = new PollRequest(regToken);
request->nlc = m_pollingConnection;
NETLIBHTTPREQUEST *response = request->Send(m_hNetlibUser);
- if (response != NULL)
+ if (response)
{
- JSONROOT root(response->pData);
- if (json_get(root, "errorCode") != NULL)
+ if (response->pData)
{
- errors++;
- continue;
+ JSONROOT root(response->pData);
+ if (json_get(root, "errorCode") != NULL)
+ {
+ errors++;
+ continue;
+ }
+ ParsePollData(root);
}
- ParsePollData (root);
- errors = 0;
m_pollingConnection = response->nlc;
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)response);
}
|