Folder improvements

This commit is contained in:
Ali
2020-03-09 13:39:06 +04:00
parent d6243fb78b
commit 05ffb47c1c
18 changed files with 237 additions and 155 deletions

View File

@@ -5,12 +5,14 @@ final class MutableBasicPeerView: MutablePostboxView {
fileprivate var peer: Peer?
fileprivate var notificationSettings: PeerNotificationSettings?
fileprivate var isContact: Bool
fileprivate var groupId: PeerGroupId?
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)
self.groupId = postbox.chatListIndexTable.get(peerId: peerId).inclusion.groupId
}
func replay(postbox: Postbox, transaction: PostboxTransaction) -> Bool {
@@ -30,6 +32,13 @@ final class MutableBasicPeerView: MutablePostboxView {
updated = true
}
}
if transaction.currentUpdatedChatListInclusions[self.peerId] != nil {
let groupId = postbox.chatListIndexTable.get(peerId: peerId).inclusion.groupId
if self.groupId != groupId {
self.groupId = groupId
updated = true
}
}
return updated
}
@@ -43,10 +52,12 @@ public final class BasicPeerView: PostboxView {
public let peer: Peer?
public let notificationSettings: PeerNotificationSettings?
public let isContact: Bool
public let groupId: PeerGroupId?
init(_ view: MutableBasicPeerView) {
self.peer = view.peer
self.notificationSettings = view.notificationSettings
self.isContact = view.isContact
self.groupId = view.groupId
}
}