Skip to content

Commit

Permalink
fixes #1872 (we shall not rely on unreadCnt field, because while we'r…
Browse files Browse the repository at this point in the history
…e offline, another client can mark these messages as read)
  • Loading branch information
George Hazan committed Mar 1, 2019
1 parent ba7a6ef commit a9047d3
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions protocols/ICQ-WIM/src/poll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a9047d3

Please sign in to comment.