Chat List Filter improvements

This commit is contained in:
Ali
2020-01-28 19:46:28 +04:00
parent 309a8b112b
commit 77826e91d4
13 changed files with 266 additions and 89 deletions

View File

@@ -570,13 +570,10 @@ final class ChatListIndexTable: Table {
func debugReindexUnreadCounts(postbox: Postbox) -> (ChatListTotalUnreadState, [PeerGroupId: PeerGroupUnreadCountersCombinedSummary]) {
var peerIds: [PeerId] = []
self.valueBox.scanInt64(self.table, values: { key, _ in
let peerId = PeerId(key)
if peerId.namespace != Int32.max {
peerIds.append(peerId)
}
return true
})
for groupId in postbox.chatListTable.existingGroups() + [.root] {
let groupPeerIds = postbox.chatListTable.allPeerIds(groupId: groupId)
peerIds.append(contentsOf: groupPeerIds)
}
var rootState = ChatListTotalUnreadState(absoluteCounters: [:], filteredCounters: [:])
var summaries: [PeerGroupId: PeerGroupUnreadCountersCombinedSummary] = [:]
for peerId in peerIds {