mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-29 06:26: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.
42 lines
1.2 KiB
Swift
42 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
public final class RenderedPeer: Equatable {
|
|
public let peerId: PeerId
|
|
public let peers: SimpleDictionary<PeerId, Peer>
|
|
public let associatedMedia: [MediaId: Media]
|
|
|
|
public init(peerId: PeerId, peers: SimpleDictionary<PeerId, Peer>, associatedMedia: [MediaId: Media]) {
|
|
self.peerId = peerId
|
|
self.peers = peers
|
|
self.associatedMedia = associatedMedia
|
|
}
|
|
|
|
public init(peer: Peer) {
|
|
self.peerId = peer.id
|
|
self.peers = SimpleDictionary([peer.id: peer])
|
|
self.associatedMedia = [:]
|
|
}
|
|
|
|
public static func ==(lhs: RenderedPeer, rhs: RenderedPeer) -> Bool {
|
|
if lhs.peerId != rhs.peerId {
|
|
return false
|
|
}
|
|
if lhs.peers.count != rhs.peers.count {
|
|
return false
|
|
}
|
|
if !lhs.peers.isEqual(other: rhs.peers, with: { p1, p2 in
|
|
return p1.isEqual(p2)
|
|
}) {
|
|
return false
|
|
}
|
|
if !areMediaDictionariesEqual(lhs.associatedMedia, rhs.associatedMedia) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
public var peer: Peer? {
|
|
return self.peers[self.peerId]
|
|
}
|
|
}
|