mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Returned unreadBadge/Muted but keep unreadWithMentionsBadge/Muted.
This commit is contained in:
@@ -3002,6 +3002,10 @@ HistoryItem *Session::addNewMessage(
|
||||
return result;
|
||||
}
|
||||
|
||||
int Session::unreadBadge() const {
|
||||
return computeUnreadBadge(_chatsList.unreadState());
|
||||
}
|
||||
|
||||
int Session::unreadWithMentionsBadge() const {
|
||||
auto state = _chatsList.unreadState();
|
||||
if (state.mentions) {
|
||||
@@ -3010,6 +3014,10 @@ int Session::unreadWithMentionsBadge() const {
|
||||
return computeUnreadBadge(state) + state.mentions;
|
||||
}
|
||||
|
||||
bool Session::unreadBadgeMuted() const {
|
||||
return computeUnreadBadgeMuted(_chatsList.unreadState());
|
||||
}
|
||||
|
||||
bool Session::unreadWithMentionsBadgeMuted() const {
|
||||
const auto state = _chatsList.unreadState();
|
||||
return !state.mentions && computeUnreadBadgeMuted(state);
|
||||
|
||||
@@ -579,7 +579,9 @@ public:
|
||||
MessageFlags localFlags,
|
||||
NewMessageType type);
|
||||
|
||||
[[nodiscard]] int unreadBadge() const;
|
||||
[[nodiscard]] int unreadWithMentionsBadge() const;
|
||||
[[nodiscard]] bool unreadBadgeMuted() const;
|
||||
[[nodiscard]] bool unreadWithMentionsBadgeMuted() const;
|
||||
[[nodiscard]] int unreadBadgeIgnoreOne(Dialogs::Key key) const;
|
||||
[[nodiscard]] bool unreadBadgeMutedIgnoreOne(Dialogs::Key key) const;
|
||||
|
||||
@@ -247,8 +247,8 @@ void Domain::updateUnreadBadge() {
|
||||
for (const auto &[index, account] : _accounts) {
|
||||
if (const auto session = account->maybeSession()) {
|
||||
const auto data = &session->data();
|
||||
_unreadBadge += data->unreadWithMentionsBadge();
|
||||
if (!data->unreadWithMentionsBadgeMuted()) {
|
||||
_unreadBadge += data->unreadBadge();
|
||||
if (!data->unreadBadgeMuted()) {
|
||||
_unreadBadgeMuted = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user