From 81e0419a0c18dd5a07a68ecac2e1fc6058bcea00 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Tue, 5 May 2015 12:51:06 +0000 Subject: SkypeWeb: TRouter errors handling. Other fixes. git-svn-id: http://svn.miranda-ng.org/main/trunk@13440 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_history_sync.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_history_sync.cpp') diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index 98b10b9a38..80155e1c88 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -197,6 +197,7 @@ void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response) if (response == NULL) return; JSONROOT root(response->pData); + if (root == NULL) return; @@ -209,6 +210,7 @@ void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response) if (totalCount >= 99 || json_size(conversations) >= 99) PushRequest(new SyncHistoryFirstRequest(syncState, RegToken), &CSkypeProto::OnSyncHistory); + bool autoSyncEnabled = getByte("AutoSync", 1); for (size_t i = 0; i < json_size(conversations); i++) { @@ -228,12 +230,14 @@ void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response) if (conversationLink != NULL && strstr(conversationLink, "/8:")) { - if (!getByte("AutoSync", 1)) continue; - skypename = ContactUrlToName(conversationLink); - MCONTACT hContact = AddContact(skypename, true); + if (autoSyncEnabled) + { + skypename = ContactUrlToName(conversationLink); + MCONTACT hContact = AddContact(skypename, true); - if (GetMessageFromDb(hContact, clientMsgId, composeTime) == NULL) - PushRequest(new GetHistoryRequest(RegToken, skypename, 100, false, 0, Server), &CSkypeProto::OnGetServerHistory); + if (GetMessageFromDb(hContact, clientMsgId, composeTime) == NULL) + PushRequest(new GetHistoryRequest(RegToken, skypename, 100, false, 0, Server), &CSkypeProto::OnGetServerHistory); + } } else if (conversationLink != NULL && strstr(conversationLink, "/19:")) { -- cgit v1.2.3