mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Removed counting of unread topics from unread state in filters.
This commit is contained in:
parent
021a5881c2
commit
f888008dc1
4 changed files with 12 additions and 2 deletions
Telegram/SourceFiles
data
dialogs
ui/widgets
window
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -337,8 +337,11 @@ not_null<Ui::RpWidget*> 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);
|
||||
|
|
|
@ -270,8 +270,11 @@ base::unique_qptr<Ui::SideBarButton> 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()
|
||||
|
|
Loading…
Add table
Reference in a new issue