mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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
|
@ -897,6 +897,7 @@ Dialogs::UnreadState ForumTopic::unreadStateFor(
|
||||||
const auto muted = this->muted();
|
const auto muted = this->muted();
|
||||||
result.messages = count;
|
result.messages = count;
|
||||||
result.chats = count ? 1 : 0;
|
result.chats = count ? 1 : 0;
|
||||||
|
result.chatsTopic = count ? 1 : 0;
|
||||||
result.mentions = unreadMentions().has() ? 1 : 0;
|
result.mentions = unreadMentions().has() ? 1 : 0;
|
||||||
result.reactions = unreadReactions().has() ? 1 : 0;
|
result.reactions = unreadReactions().has() ? 1 : 0;
|
||||||
result.messagesMuted = muted ? result.messages : 0;
|
result.messagesMuted = muted ? result.messages : 0;
|
||||||
|
|
|
@ -65,6 +65,7 @@ struct UnreadState {
|
||||||
int messagesMuted = 0;
|
int messagesMuted = 0;
|
||||||
int chats = 0;
|
int chats = 0;
|
||||||
int chatsMuted = 0;
|
int chatsMuted = 0;
|
||||||
|
int chatsTopic = 0;
|
||||||
int marks = 0;
|
int marks = 0;
|
||||||
int marksMuted = 0;
|
int marksMuted = 0;
|
||||||
int reactions = 0;
|
int reactions = 0;
|
||||||
|
@ -77,6 +78,7 @@ struct UnreadState {
|
||||||
messagesMuted += other.messagesMuted;
|
messagesMuted += other.messagesMuted;
|
||||||
chats += other.chats;
|
chats += other.chats;
|
||||||
chatsMuted += other.chatsMuted;
|
chatsMuted += other.chatsMuted;
|
||||||
|
chatsTopic += other.chatsTopic;
|
||||||
marks += other.marks;
|
marks += other.marks;
|
||||||
marksMuted += other.marksMuted;
|
marksMuted += other.marksMuted;
|
||||||
reactions += other.reactions;
|
reactions += other.reactions;
|
||||||
|
@ -89,6 +91,7 @@ struct UnreadState {
|
||||||
messagesMuted -= other.messagesMuted;
|
messagesMuted -= other.messagesMuted;
|
||||||
chats -= other.chats;
|
chats -= other.chats;
|
||||||
chatsMuted -= other.chatsMuted;
|
chatsMuted -= other.chatsMuted;
|
||||||
|
chatsTopic -= other.chatsTopic;
|
||||||
marks -= other.marks;
|
marks -= other.marks;
|
||||||
marksMuted -= other.marksMuted;
|
marksMuted -= other.marksMuted;
|
||||||
reactions -= other.reactions;
|
reactions -= other.reactions;
|
||||||
|
|
|
@ -337,8 +337,11 @@ not_null<Ui::RpWidget*> AddChatFiltersTabsStrip(
|
||||||
) | rpl::start_with_next([=](
|
) | rpl::start_with_next([=](
|
||||||
const Dialogs::UnreadState &state,
|
const Dialogs::UnreadState &state,
|
||||||
bool includeMuted) {
|
bool includeMuted) {
|
||||||
|
const auto chats = state.chatsTopic
|
||||||
|
? (state.chats - state.chatsTopic + 1)
|
||||||
|
: state.chats;
|
||||||
const auto muted = (state.chatsMuted + state.marksMuted);
|
const auto muted = (state.chatsMuted + state.marksMuted);
|
||||||
const auto count = (state.chats + state.marks)
|
const auto count = (chats + state.marks)
|
||||||
- (includeMuted ? 0 : muted);
|
- (includeMuted ? 0 : muted);
|
||||||
const auto isMuted = includeMuted && (count == muted);
|
const auto isMuted = includeMuted && (count == muted);
|
||||||
slider->setUnreadCount(i, count, isMuted);
|
slider->setUnreadCount(i, count, isMuted);
|
||||||
|
|
|
@ -270,8 +270,11 @@ base::unique_qptr<Ui::SideBarButton> FiltersMenu::prepareButton(
|
||||||
) | rpl::start_with_next([=](
|
) | rpl::start_with_next([=](
|
||||||
const Dialogs::UnreadState &state,
|
const Dialogs::UnreadState &state,
|
||||||
bool includeMuted) {
|
bool includeMuted) {
|
||||||
|
const auto chats = state.chatsTopic
|
||||||
|
? (state.chats - state.chatsTopic + 1)
|
||||||
|
: state.chats;
|
||||||
const auto muted = (state.chatsMuted + state.marksMuted);
|
const auto muted = (state.chatsMuted + state.marksMuted);
|
||||||
const auto count = (state.chats + state.marks)
|
const auto count = (chats + state.marks)
|
||||||
- (includeMuted ? 0 : muted);
|
- (includeMuted ? 0 : muted);
|
||||||
const auto string = !count
|
const auto string = !count
|
||||||
? QString()
|
? QString()
|
||||||
|
|
Loading…
Add table
Reference in a new issue