mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Tab support
This commit is contained in:
@@ -3,10 +3,12 @@ import Foundation
|
||||
final class MutableBasicPeerView: MutablePostboxView {
|
||||
private let peerId: PeerId
|
||||
fileprivate var peer: Peer?
|
||||
fileprivate var notificationSettings: PeerNotificationSettings?
|
||||
|
||||
init(postbox: Postbox, peerId: PeerId) {
|
||||
self.peerId = peerId
|
||||
self.peer = postbox.peerTable.get(peerId)
|
||||
self.notificationSettings = postbox.peerNotificationSettingsTable.getEffective(peerId)
|
||||
}
|
||||
|
||||
func replay(postbox: Postbox, transaction: PostboxTransaction) -> Bool {
|
||||
@@ -15,6 +17,10 @@ final class MutableBasicPeerView: MutablePostboxView {
|
||||
self.peer = peer
|
||||
updated = true
|
||||
}
|
||||
if transaction.currentUpdatedPeerNotificationSettings[self.peerId] != nil {
|
||||
self.notificationSettings = postbox.peerNotificationSettingsTable.getEffective(peerId)
|
||||
updated = true
|
||||
}
|
||||
|
||||
return updated
|
||||
}
|
||||
@@ -26,8 +32,10 @@ final class MutableBasicPeerView: MutablePostboxView {
|
||||
|
||||
public final class BasicPeerView: PostboxView {
|
||||
public let peer: Peer?
|
||||
public let notificationSettings: PeerNotificationSettings?
|
||||
|
||||
init(_ view: MutableBasicPeerView) {
|
||||
self.peer = view.peer
|
||||
self.notificationSettings = view.notificationSettings
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user