mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-07 14:53:35 +00:00
Fix exclude muted from total count
This commit is contained in:
parent
04d3fefa71
commit
dd0b7b2b2a
@ -104,6 +104,14 @@ func chatListFilterItems(context: AccountContext) -> Signal<(Int, [(ChatListFilt
|
||||
var hasUnmutedUnread = false
|
||||
if let totalState = totalStates[.root] {
|
||||
for tag in tags {
|
||||
if filter.data.excludeMuted {
|
||||
if let value = totalState.filteredCounters[tag] {
|
||||
if value.chatCount != 0 {
|
||||
count += Int(value.chatCount)
|
||||
hasUnmutedUnread = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let value = totalState.absoluteCounters[tag] {
|
||||
count += Int(value.chatCount)
|
||||
}
|
||||
@ -114,9 +122,18 @@ func chatListFilterItems(context: AccountContext) -> Signal<(Int, [(ChatListFilt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if !filter.data.excludeArchived {
|
||||
if let totalState = totalStates[Namespaces.PeerGroup.archive] {
|
||||
for tag in tags {
|
||||
if filter.data.excludeMuted {
|
||||
if let value = totalState.filteredCounters[tag] {
|
||||
if value.chatCount != 0 {
|
||||
count += Int(value.chatCount)
|
||||
hasUnmutedUnread = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let value = totalState.absoluteCounters[tag] {
|
||||
count += Int(value.chatCount)
|
||||
}
|
||||
@ -128,6 +145,7 @@ func chatListFilterItems(context: AccountContext) -> Signal<(Int, [(ChatListFilt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for peerId in filter.data.includePeers {
|
||||
if let (tag, peerCount, hasUnmuted) = peerTagAndCount[peerId] {
|
||||
if !tags.contains(tag) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user