This commit is contained in:
Ali
2021-09-03 00:45:22 +04:00
parent 8aefa19d31
commit 1fe0d4a75b
53 changed files with 489 additions and 566 deletions

View File

@@ -115,8 +115,8 @@ public enum ChatListNamespaceEntry {
public var index: ChatListIndex {
switch self {
case let .peer(peer):
return peer.index
case let .peer(index, _, _, _, _):
return index
case let .hole(index):
return ChatListIndex(pinningIndex: nil, messageIndex: index)
}
@@ -245,8 +245,8 @@ final class ChatListTable: Table {
}
}
func getUnreadChatListPeerIds(postbox: Postbox, groupId: PeerGroupId, filterPredicate: ChatListFilterPredicate?) -> [PeerId] {
let globalNotificationSettings = postbox.getGlobalNotificationSettings()
func getUnreadChatListPeerIds(postbox: Postbox, currentTransaction: Transaction, groupId: PeerGroupId, filterPredicate: ChatListFilterPredicate?) -> [PeerId] {
let globalNotificationSettings = postbox.getGlobalNotificationSettings(transaction: currentTransaction)
var result: [PeerId] = []
self.valueBox.range(self.table, start: self.upperBound(groupId: groupId), end: self.lowerBound(groupId: groupId), keys: { key in
@@ -797,13 +797,13 @@ final class ChatListTable: Table {
return entries
}
func getRelativeUnreadChatListIndex(postbox: Postbox, filtered: Bool, position: ChatListRelativePosition, groupId: PeerGroupId) -> ChatListIndex? {
func getRelativeUnreadChatListIndex(postbox: Postbox, currentTransaction: Transaction, filtered: Bool, position: ChatListRelativePosition, groupId: PeerGroupId) -> ChatListIndex? {
var result: ChatListIndex?
let lower: ValueBoxKey
let upper: ValueBoxKey
let globalNotificationSettings = postbox.getGlobalNotificationSettings()
let globalNotificationSettings = postbox.getGlobalNotificationSettings(transaction: currentTransaction)
switch position {
case let .earlier(index):