2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fixed display tags with NoRead flag while history has fake unread state.

This commit is contained in:
23rd
2024-11-21 04:46:13 +03:00
parent 5362d54ab6
commit d5dbbd566f
4 changed files with 37 additions and 3 deletions

View File

@@ -283,7 +283,9 @@ const base::flat_set<not_null<History*>> &ChatFilter::never() const {
return _never;
}
bool ChatFilter::contains(not_null<History*> history) const {
bool ChatFilter::contains(
not_null<History*> history,
bool ignoreFakeUnread) const {
const auto flag = [&] {
const auto peer = history->peer;
if (const auto user = peer->asUser()) {
@@ -320,7 +322,7 @@ bool ChatFilter::contains(not_null<History*> history) const {
&& (!(_flags & Flag::NoRead)
|| state.unread
|| state.mention
|| history->fakeUnreadWhileOpened())
|| (!ignoreFakeUnread && history->fakeUnreadWhileOpened()))
&& (!(_flags & Flag::NoArchived)
|| (history->folderKnown() && !history->folder())))
|| _always.contains(history);

View File

@@ -81,7 +81,9 @@ public:
[[nodiscard]] const std::vector<not_null<History*>> &pinned() const;
[[nodiscard]] const base::flat_set<not_null<History*>> &never() const;
[[nodiscard]] bool contains(not_null<History*> history) const;
[[nodiscard]] bool contains(
not_null<History*> history,
bool ignoreFakeUnread = false) const;
private:
FilterId _id = 0;