diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-20 06:55:47 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-20 06:55:47 +0000 |
commit | 84ca19d48717e38a337c848a71c3f7c97ee59858 (patch) | |
tree | 33e67fa1dedfb45f0b2ff35f06c4b5726444e561 /protocols/SkypeWeb | |
parent | 83e1cd0fdc2123754eb4191a2223fc434a8d8230 (diff) |
SkypeWeb: 100+ messages sync fix(?).
git-svn-id: http://svn.miranda-ng.org/main/trunk@12952 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_history_sync.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index 597ac3dc36..d633dfe8a3 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -29,14 +29,15 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) return;
JSONNODE *metadata = json_get(root, "_metadata");
+ JSONNODE *conversations = json_as_array(json_get(root, "messages"));
int totalCount = json_as_int(json_get(metadata, "totalCount"));
ptrA syncState(mir_t2a(ptrT(json_as_string(json_get(metadata, "syncState")))));
- if (totalCount >= 99)
+
+ if (totalCount >= 99 || json_size(conversations) >= 99)
PushRequest(new GetHistoryOnUrlRequest(syncState, RegToken), &CSkypeProto::OnGetServerHistory);
- JSONNODE *conversations = json_as_array(json_get(root, "messages"));
for (size_t i = 0; i < json_size(conversations); i++)
{
JSONNODE *message = json_at(conversations, i);
@@ -128,14 +129,15 @@ void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response) return;
JSONNODE *metadata = json_get(root, "_metadata");
+ JSONNODE *conversations = json_as_array(json_get(root, "conversations"));
int totalCount = json_as_int(json_get(metadata, "totalCount"));
ptrA syncState(mir_t2a(ptrT(json_as_string(json_get(metadata, "syncState")))));
- if (totalCount >= 99)
+ if (totalCount >= 99 || json_size(conversations) >= 99)
PushRequest(new SyncHistoryFirstRequest(syncState, RegToken), &CSkypeProto::OnSyncHistory);
- JSONNODE *conversations = json_as_array(json_get(root, "conversations"));
+
for (size_t i = 0; i < json_size(conversations); i++)
{
JSONNODE *conversation = json_at(conversations, i);
|