mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Update filters
This commit is contained in:
@@ -60,6 +60,21 @@ final class ContactTable: Table {
|
||||
self.peerIds = nil
|
||||
}
|
||||
|
||||
func transactionUpdatedPeers() -> [PeerId: (Bool, Bool)] {
|
||||
var result: [PeerId: (Bool, Bool)] = [:]
|
||||
if let peerIdsBeforeModification = self.peerIdsBeforeModification {
|
||||
if let peerIds = self.peerIds {
|
||||
let removedPeerIds = peerIdsBeforeModification.subtracting(peerIds)
|
||||
let addedPeerIds = peerIds.subtracting(peerIdsBeforeModification)
|
||||
|
||||
for peerId in removedPeerIds.union(addedPeerIds) {
|
||||
result[peerId] = (removedPeerIds.contains(peerId), addedPeerIds.contains(peerId))
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
override func beforeCommit() {
|
||||
if let peerIdsBeforeModification = self.peerIdsBeforeModification {
|
||||
if let peerIds = self.peerIds {
|
||||
|
||||
Reference in New Issue
Block a user