2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix reading of client side unread messages.

This commit is contained in:
John Preston
2019-04-30 13:48:48 +04:00
parent c9552390e7
commit 39008bf6fe
4 changed files with 25 additions and 7 deletions

View File

@@ -1540,9 +1540,21 @@ void History::calculateFirstUnreadMessage() {
}
}
void History::readClientSideMessages() {
for (const auto &block : blocks) {
for (const auto &view : block->messages) {
const auto item = view->data();
if (!item->out()) {
item->markClientSideAsRead();
}
}
}
}
MsgId History::readInbox() {
const auto upTo = msgIdForRead();
setUnreadCount(0);
readClientSideMessages();
if (upTo) {
inboxRead(upTo);
}