mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Count all accounts in Core::App().unreadBadge.
This commit is contained in:
@@ -236,8 +236,8 @@ Session::Session(not_null<Main::Session*> session)
|
||||
setupUserIsContactViewer();
|
||||
|
||||
_chatsList.unreadStateChanges(
|
||||
) | rpl::start_with_next([] {
|
||||
Notify::unreadCounterUpdated();
|
||||
) | rpl::start_with_next([=] {
|
||||
notifyUnreadBadgeChanged();
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
@@ -2082,6 +2082,14 @@ int Session::unreadOnlyMutedBadge() const {
|
||||
: state.chatsMuted;
|
||||
}
|
||||
|
||||
rpl::producer<> Session::unreadBadgeChanges() const {
|
||||
return _unreadBadgeChanges.events();
|
||||
}
|
||||
|
||||
void Session::notifyUnreadBadgeChanged() {
|
||||
_unreadBadgeChanges.fire({});
|
||||
}
|
||||
|
||||
int Session::computeUnreadBadge(const Dialogs::UnreadState &state) const {
|
||||
const auto all = _session->settings().includeMutedCounter();
|
||||
return std::max(state.marks - (all ? 0 : state.marksMuted), 0)
|
||||
|
Reference in New Issue
Block a user