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

Count unread marks in non-fully loaded folders.

This commit is contained in:
John Preston
2019-04-24 19:28:01 +04:00
parent 4c571f5bff
commit 5f62c2100c
6 changed files with 109 additions and 156 deletions

View File

@@ -2029,12 +2029,14 @@ bool History::chatListMutedBadge() const {
Dialogs::UnreadState History::chatListUnreadState() const {
auto result = Dialogs::UnreadState();
const auto count = _unreadCount.value_or(0);
result.messagesCount = _unreadCount;
result.messagesCountMuted = (_unreadCount && mute()) ? count : 0;
result.chatsCount = count ? 1 : 0;
result.chatsCountMuted = (count && mute()) ? 1 : 0;
result.mark = _unreadMark;
result.markMuted = mute() ? _unreadMark : false;
const auto mark = !count && _unreadMark;
result.messages = count;
result.messagesMuted = mute() ? count : 0;
result.chats = count ? 1 : 0;
result.chatsMuted = (count && mute()) ? 1 : 0;
result.marks = mark ? 1 : 0;
result.marksMuted = (mark && mute()) ? 1 : 0;
result.known = _unreadCount.has_value();
return result;
}