Files
GLEGram-iOS/submodules/Postbox/Sources/ContactPeerIdsView.swift
T
Leeksov 4647310322 GLEGram 12.5 — Initial public release
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.
2026-04-06 09:48:12 +03:00

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