mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Folder improvements
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user