Tab support

This commit is contained in:
Ali
2020-02-19 00:10:28 +04:00
parent 2505082eee
commit 507e17f40f
34 changed files with 1759 additions and 201 deletions

View File

@@ -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
}
}