summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/server.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-07-21 18:12:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-07-21 18:12:04 +0300
commit47687c2f661b8a0515f8624caa513a72b29cbb9a (patch)
tree4f9bfb56b6e36c7c7d0b0281cb1adfc5a2d786ce /protocols/ICQ-WIM/src/server.cpp
parentde061b9f00ae2fac52c2400f27588d11e0397251 (diff)
fixes #2277 (ICQ: add ability to load whole history from server)
Diffstat (limited to 'protocols/ICQ-WIM/src/server.cpp')
-rw-r--r--protocols/ICQ-WIM/src/server.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index 715b3487e4..14e7164477 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -931,11 +931,17 @@ void CIcqProto::OnGetUserHistory(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pR
__int64 lastMsgId = getId(pReq->hContact, DB_KEY_LASTMSGID);
+ int count = 0;
auto &results = root.results();
- for (auto &it : results["messages"])
+ for (auto &it : results["messages"]) {
ParseMessage(pReq->hContact, lastMsgId, it, pReq->pUserInfo != nullptr, false);
+ count++;
+ }
setId(pReq->hContact, DB_KEY_LASTMSGID, lastMsgId);
+
+ if (count >= 999)
+ RetrieveUserHistory(pReq->hContact, lastMsgId, pReq->pUserInfo != nullptr);
}
void CIcqProto::OnGetUserInfo(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq)