diff --git a/Telegram/SourceFiles/data/data_forum_topic.cpp b/Telegram/SourceFiles/data/data_forum_topic.cpp index 7e7998897..d7ad7565a 100644 --- a/Telegram/SourceFiles/data/data_forum_topic.cpp +++ b/Telegram/SourceFiles/data/data_forum_topic.cpp @@ -897,6 +897,7 @@ Dialogs::UnreadState ForumTopic::unreadStateFor( const auto muted = this->muted(); result.messages = count; result.chats = count ? 1 : 0; + result.chatsTopic = count ? 1 : 0; result.mentions = unreadMentions().has() ? 1 : 0; result.reactions = unreadReactions().has() ? 1 : 0; result.messagesMuted = muted ? result.messages : 0; diff --git a/Telegram/SourceFiles/dialogs/dialogs_entry.h b/Telegram/SourceFiles/dialogs/dialogs_entry.h index 3a19eec68..ec61c0378 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_entry.h +++ b/Telegram/SourceFiles/dialogs/dialogs_entry.h @@ -65,6 +65,7 @@ struct UnreadState { int messagesMuted = 0; int chats = 0; int chatsMuted = 0; + int chatsTopic = 0; int marks = 0; int marksMuted = 0; int reactions = 0; @@ -77,6 +78,7 @@ struct UnreadState { messagesMuted += other.messagesMuted; chats += other.chats; chatsMuted += other.chatsMuted; + chatsTopic += other.chatsTopic; marks += other.marks; marksMuted += other.marksMuted; reactions += other.reactions; @@ -89,6 +91,7 @@ struct UnreadState { messagesMuted -= other.messagesMuted; chats -= other.chats; chatsMuted -= other.chatsMuted; + chatsTopic -= other.chatsTopic; marks -= other.marks; marksMuted -= other.marksMuted; reactions -= other.reactions; diff --git a/Telegram/SourceFiles/ui/widgets/chat_filters_tabs_strip.cpp b/Telegram/SourceFiles/ui/widgets/chat_filters_tabs_strip.cpp index 2c4472e79..65e9a9de8 100644 --- a/Telegram/SourceFiles/ui/widgets/chat_filters_tabs_strip.cpp +++ b/Telegram/SourceFiles/ui/widgets/chat_filters_tabs_strip.cpp @@ -337,8 +337,11 @@ not_null AddChatFiltersTabsStrip( ) | rpl::start_with_next([=]( const Dialogs::UnreadState &state, bool includeMuted) { + const auto chats = state.chatsTopic + ? (state.chats - state.chatsTopic + 1) + : state.chats; const auto muted = (state.chatsMuted + state.marksMuted); - const auto count = (state.chats + state.marks) + const auto count = (chats + state.marks) - (includeMuted ? 0 : muted); const auto isMuted = includeMuted && (count == muted); slider->setUnreadCount(i, count, isMuted); diff --git a/Telegram/SourceFiles/window/window_filters_menu.cpp b/Telegram/SourceFiles/window/window_filters_menu.cpp index f3e07eea9..d5d2fdd99 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.cpp +++ b/Telegram/SourceFiles/window/window_filters_menu.cpp @@ -270,8 +270,11 @@ base::unique_qptr FiltersMenu::prepareButton( ) | rpl::start_with_next([=]( const Dialogs::UnreadState &state, bool includeMuted) { + const auto chats = state.chatsTopic + ? (state.chats - state.chatsTopic + 1) + : state.chats; const auto muted = (state.chatsMuted + state.marksMuted); - const auto count = (state.chats + state.marks) + const auto count = (chats + state.marks) - (includeMuted ? 0 : muted); const auto string = !count ? QString()