mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-25 15:03:03 +02:00
Fix muted state of monoforums.
This commit is contained in:
parent
eccfd75a83
commit
9b989329d4
3 changed files with 21 additions and 10 deletions
|
@ -96,6 +96,17 @@ Thread *SavedMessages::activeSubsectionThread() const {
|
|||
return _activeSubsectionSublist;
|
||||
}
|
||||
|
||||
Dialogs::UnreadState SavedMessages::unreadStateWithParentMuted() const {
|
||||
auto result = _chatsList.unreadState();
|
||||
if (_owningHistory->muted()) {
|
||||
result.chatsMuted = result.chats;
|
||||
result.marksMuted = result.marks;
|
||||
result.messagesMuted = result.messages;
|
||||
result.reactionsMuted = result.reactions;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
SavedMessages::~SavedMessages() {
|
||||
clear();
|
||||
}
|
||||
|
|
|
@ -9,6 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "dialogs/dialogs_main_list.h"
|
||||
|
||||
namespace Dialogs {
|
||||
struct UnreadState;
|
||||
} // namespace Dialogs
|
||||
|
||||
namespace Main {
|
||||
class Session;
|
||||
} // namespace Main
|
||||
|
@ -80,6 +84,8 @@ public:
|
|||
void saveActiveSubsectionThread(not_null<Thread*> thread);
|
||||
Thread *activeSubsectionThread() const;
|
||||
|
||||
[[nodiscard]] Dialogs::UnreadState unreadStateWithParentMuted() const;
|
||||
|
||||
[[nodiscard]] rpl::lifetime &lifetime();
|
||||
|
||||
private:
|
||||
|
|
|
@ -2369,14 +2369,8 @@ Dialogs::UnreadState History::chatListUnreadState() const {
|
|||
if (const auto forum = peer->forum()) {
|
||||
return AdjustedForumUnreadState(forum->topicsList()->unreadState());
|
||||
} else if (const auto monoforum = peer->monoforum()) {
|
||||
auto state = monoforum->chatsList()->unreadState();
|
||||
if (muted()) {
|
||||
state.chatsMuted = state.chats;
|
||||
state.marksMuted = state.marks;
|
||||
state.messagesMuted = state.messages;
|
||||
state.reactionsMuted = state.reactions;
|
||||
}
|
||||
return AdjustedForumUnreadState(state);
|
||||
return AdjustedForumUnreadState(
|
||||
monoforum->unreadStateWithParentMuted());
|
||||
}
|
||||
return computeUnreadState();
|
||||
}
|
||||
|
@ -2391,9 +2385,9 @@ Dialogs::BadgesState History::chatListBadgesState() const {
|
|||
} else if (const auto monoforum = peer->monoforum()) {
|
||||
return adjustBadgesStateByFolder(
|
||||
Dialogs::BadgesForUnread(
|
||||
monoforum->chatsList()->unreadState(),
|
||||
monoforum->unreadStateWithParentMuted(),
|
||||
Dialogs::CountInBadge::Chats,
|
||||
Dialogs::IncludeInBadge::UnmutedOrAll));
|
||||
Dialogs::IncludeInBadge::All));
|
||||
}
|
||||
return computeBadgesState();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue