for migration

This commit is contained in:
overtake 2017-03-12 19:04:13 +03:00
parent ff5c66e7bb
commit f99074c62d
2 changed files with 8 additions and 1 deletions

View File

@ -15,7 +15,7 @@ public class AutoremoveTimeoutMessageAttribute: MessageAttribute {
public var associatedMessageIds: [MessageId] = []
init(timeout: Int32, countdownBeginTime: Int32?) {
public init(timeout: Int32, countdownBeginTime: Int32?) {
self.timeout = timeout
self.countdownBeginTime = countdownBeginTime
}

View File

@ -19,4 +19,11 @@ public struct SecretChatStateBridge {
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)
}