diff options
Diffstat (limited to 'protocols/ICQ-WIM/src/poll.cpp')
-rw-r--r-- | protocols/ICQ-WIM/src/poll.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp index 7360544ec5..b25dd4c71e 100644 --- a/protocols/ICQ-WIM/src/poll.cpp +++ b/protocols/ICQ-WIM/src/poll.cpp @@ -152,8 +152,18 @@ void CIcqProto::ProcessHistData(const JSONNode &ev) } // or load missing messages if any - if (ev["unreadCnt"].as_int() > 0) + 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: RetrieveUserHistory(hContact, lastMsgId); + } // check remote read if (g_bMessageState) { |