mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-30 23:08:10 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
35 lines
1.0 KiB
Swift
35 lines
1.0 KiB
Swift
import Foundation
|
|
|
|
final class MutableContactPeerIdsView {
|
|
fileprivate var remoteTotalCount: Int32
|
|
fileprivate var peerIds: Set<PeerId>
|
|
|
|
init(remoteTotalCount: Int32, peerIds: Set<PeerId>) {
|
|
self.remoteTotalCount = remoteTotalCount
|
|
self.peerIds = peerIds
|
|
}
|
|
|
|
func replay(updateRemoteTotalCount: Int32?, replace replacePeerIds: Set<PeerId>) -> Bool {
|
|
var updated = false
|
|
if let updateRemoteTotalCount = updateRemoteTotalCount, self.remoteTotalCount != updateRemoteTotalCount {
|
|
self.remoteTotalCount = updateRemoteTotalCount
|
|
updated = true
|
|
}
|
|
if self.peerIds != replacePeerIds {
|
|
self.peerIds = replacePeerIds
|
|
updated = true
|
|
}
|
|
return updated
|
|
}
|
|
}
|
|
|
|
public final class ContactPeerIdsView {
|
|
public let remoteTotalCount: Int32
|
|
public let peerIds: Set<PeerId>
|
|
|
|
init(_ mutableView: MutableContactPeerIdsView) {
|
|
self.remoteTotalCount = mutableView.remoteTotalCount
|
|
self.peerIds = mutableView.peerIds
|
|
}
|
|
}
|