summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-01 17:15:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-01 17:15:11 +0300
commita9047d304ccd9c25fa254417f39911c6e079339c (patch)
treebb18332dabf2ebe55b3c8076a9c7dcce7a0577f2
parentba7a6efb9876e401a353015b121de237182eb305 (diff)
fixes #1872 (we shall not rely on unreadCnt field, because while we're offline, another client can mark these messages as read)
-rw-r--r--protocols/ICQ-WIM/src/poll.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp
index 8c0147bca8..6cd4575e13 100644
--- a/protocols/ICQ-WIM/src/poll.cpp
+++ b/protocols/ICQ-WIM/src/poll.cpp
@@ -154,18 +154,9 @@ void CIcqProto::ProcessHistData(const JSONNode &ev)
}
// or load missing messages if any
- switch (ev["unreadCnt"].as_int()) {
- case 0: break;
- case 1:
- if (!IsChat(wszId))
- for (auto &it : ev["tail"]["messages"])
- ParseMessage(hContact, lastMsgId, it, false);
- setId(hContact, DB_KEY_LASTMSGID, lastMsgId);
- break;
-
- default:
+ __int64 srvLastId = _wtoi64(ev["lastMsgId"].as_mstring());
+ if (srvLastId > lastMsgId)
RetrieveUserHistory(hContact, lastMsgId);
- }
// check remote read
if (g_bMessageState) {