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:
@@ -4,11 +4,13 @@ final class MutableBasicPeerView: MutablePostboxView {
|
||||
private let peerId: PeerId
|
||||
fileprivate var peer: Peer?
|
||||
fileprivate var notificationSettings: PeerNotificationSettings?
|
||||
fileprivate var isContact: Bool
|
||||
|
||||
init(postbox: Postbox, peerId: PeerId) {
|
||||
self.peerId = peerId
|
||||
self.peer = postbox.peerTable.get(peerId)
|
||||
self.notificationSettings = postbox.peerNotificationSettingsTable.getEffective(peerId)
|
||||
self.isContact = postbox.contactsTable.isContact(peerId: self.peerId)
|
||||
}
|
||||
|
||||
func replay(postbox: Postbox, transaction: PostboxTransaction) -> Bool {
|
||||
@@ -21,6 +23,13 @@ final class MutableBasicPeerView: MutablePostboxView {
|
||||
self.notificationSettings = postbox.peerNotificationSettingsTable.getEffective(peerId)
|
||||
updated = true
|
||||
}
|
||||
if transaction.replaceContactPeerIds != nil {
|
||||
let isContact = postbox.contactsTable.isContact(peerId: self.peerId)
|
||||
if isContact != self.isContact {
|
||||
self.isContact = isContact
|
||||
updated = true
|
||||
}
|
||||
}
|
||||
|
||||
return updated
|
||||
}
|
||||
@@ -33,9 +42,11 @@ final class MutableBasicPeerView: MutablePostboxView {
|
||||
public final class BasicPeerView: PostboxView {
|
||||
public let peer: Peer?
|
||||
public let notificationSettings: PeerNotificationSettings?
|
||||
public let isContact: Bool
|
||||
|
||||
init(_ view: MutableBasicPeerView) {
|
||||
self.peer = view.peer
|
||||
self.notificationSettings = view.notificationSettings
|
||||
self.isContact = view.isContact
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user