2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 07:35:12 +00:00

Ignore unread counts in non-opened topics.

This commit is contained in:
John Preston
2022-10-20 13:33:04 +04:00
parent 7aea54ad8f
commit 3a967bbbfe
5 changed files with 32 additions and 8 deletions

View File

@@ -153,6 +153,9 @@ ForumTopic::ForumTopic(not_null<Forum*> forum, MsgId rootId)
_sendActionPainter->setTopic(this);
_replies->unreadCountValue(
) | rpl::map([=](std::optional<int> value) {
return value ? _replies->displayedUnreadCount() : value;
}) | rpl::distinct_until_changed(
) | rpl::combine_previous(
) | rpl::filter([=] {
return inChatList();
@@ -620,7 +623,7 @@ not_null<HistoryView::SendActionPainter*> ForumTopic::sendActionPainter() {
Dialogs::UnreadState ForumTopic::chatListUnreadState() const {
return unreadStateFor(
_replies->unreadCountCurrent(),
_replies->displayedUnreadCount(),
_replies->unreadCountKnown());
}