mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-17 11:00:07 +00:00
30 lines
923 B
Swift
30 lines
923 B
Swift
import Foundation
|
|
#if os(macOS)
|
|
import PostboxMac
|
|
#else
|
|
import Postbox
|
|
#endif
|
|
|
|
public enum SecretChatBridgeRole: Int32 {
|
|
case creator
|
|
case participant
|
|
}
|
|
|
|
public struct SecretChatStateBridge {
|
|
public let role:SecretChatBridgeRole
|
|
public init(role: SecretChatBridgeRole) {
|
|
self.role = role
|
|
}
|
|
|
|
public var state: PeerChatState {
|
|
return SecretChatState(role: SecretChatRole(rawValue: role.rawValue)!, embeddedState: .terminated, keychain: SecretChatKeychain(keys: []), keyFingerprint: nil, messageAutoremoveTimeout: nil)
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public func terminateLegacySecretChat(modifier: Modifier, peerId: PeerId, state: SecretChatStateBridge) -> PeerChatState {
|
|
return addSecretChatOutgoingOperation(modifier: modifier, peerId: peerId, operation: SecretChatOutgoingOperationContents.terminate, state: state.state as! SecretChatState).withUpdatedEmbeddedState(.terminated)
|
|
}
|