mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Show non-read non-opened topics as unread.
This commit is contained in:
parent
bc5aa7338e
commit
ce631436bf
2 changed files with 8 additions and 2 deletions
|
@ -47,6 +47,7 @@ Forum::Forum(not_null<History*> history)
|
|||
, _topicsList(&session(), {}, owner().maxPinnedChatsLimitValue(this)) {
|
||||
Expects(_history->peer->isChannel());
|
||||
|
||||
|
||||
if (_history->inChatList()) {
|
||||
preloadTopics();
|
||||
}
|
||||
|
@ -154,6 +155,7 @@ void Forum::requestTopics() {
|
|||
if (_topicsList.loaded()) {
|
||||
_chatsListLoadedEvents.fire({});
|
||||
}
|
||||
reorderLastTopics();
|
||||
requestSomeStale();
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
_requestId = 0;
|
||||
|
@ -409,7 +411,6 @@ ForumTopic *Forum::applyTopicAdded(
|
|||
if (!creating(rootId)) {
|
||||
raw->addToChatList(FilterId(), topicsList());
|
||||
_chatsListChanges.fire({});
|
||||
|
||||
reorderLastTopics();
|
||||
}
|
||||
return raw;
|
||||
|
|
|
@ -743,10 +743,15 @@ Dialogs::UnreadState ForumTopic::chatListUnreadState() const {
|
|||
}
|
||||
|
||||
Dialogs::BadgesState ForumTopic::chatListBadgesState() const {
|
||||
return Dialogs::BadgesForUnread(
|
||||
auto result = Dialogs::BadgesForUnread(
|
||||
chatListUnreadState(),
|
||||
Dialogs::CountInBadge::Messages,
|
||||
Dialogs::IncludeInBadge::All);
|
||||
if (!result.unread && _replies->inboxReadTillId() < 2) {
|
||||
result.unread = channel()->amIn()
|
||||
&& (_lastKnownServerMessageId > history()->inboxReadTillId());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Dialogs::UnreadState ForumTopic::unreadStateFor(
|
||||
|
|
Loading…
Add table
Reference in a new issue