mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Experimental chat list filtering
This commit is contained in:
@@ -225,7 +225,7 @@ final class PeerNotificationSettingsTable: Table {
|
||||
return (added, removed)
|
||||
}
|
||||
|
||||
func resetAll(to settings: PeerNotificationSettings, updatedSettings: inout Set<PeerId>, updatedTimestamps: inout [PeerId: PeerNotificationSettingsBehaviorTimestamp]) -> [PeerId] {
|
||||
func resetAll(to settings: PeerNotificationSettings, updatedSettings: inout Set<PeerId>, updatedTimestamps: inout [PeerId: PeerNotificationSettingsBehaviorTimestamp]) -> [PeerId: PeerNotificationSettings?] {
|
||||
let lowerBound = ValueBoxKey(length: 8)
|
||||
lowerBound.setInt64(0, value: 0)
|
||||
let upperBound = ValueBoxKey(length: 8)
|
||||
@@ -236,17 +236,17 @@ final class PeerNotificationSettingsTable: Table {
|
||||
return true
|
||||
}, limit: 0)
|
||||
|
||||
var updatedPeerIds: [PeerId] = []
|
||||
var updatedPeers: [PeerId: PeerNotificationSettings?] = [:]
|
||||
for peerId in peerIds {
|
||||
let entry = self.getEntry(peerId)
|
||||
if let current = entry.current, !current.isEqual(to: settings) || entry.pending != nil {
|
||||
let _ = self.setCurrent(id: peerId, settings: settings, updatedTimestamps: &updatedTimestamps)
|
||||
let _ = self.setPending(id: peerId, settings: nil, updatedSettings: &updatedSettings)
|
||||
updatedPeerIds.append(peerId)
|
||||
updatedPeers[peerId] = entry.effective
|
||||
}
|
||||
}
|
||||
|
||||
return updatedPeerIds
|
||||
return updatedPeers
|
||||
}
|
||||
|
||||
override func beforeCommit() {
|
||||
|
||||
Reference in New Issue
Block a user