mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
22 lines
721 B
Swift
22 lines
721 B
Swift
import Postbox
|
|
|
|
public final class SynchronizeChatInputStateOperation: PostboxCoding {
|
|
public let previousState: SynchronizeableChatInputState?
|
|
|
|
public init(previousState: SynchronizeableChatInputState?) {
|
|
self.previousState = previousState
|
|
}
|
|
|
|
public init(decoder: PostboxDecoder) {
|
|
self.previousState = decoder.decodeObjectForKey("p", decoder: { SynchronizeableChatInputState(decoder: $0) }) as? SynchronizeableChatInputState
|
|
}
|
|
|
|
public func encode(_ encoder: PostboxEncoder) {
|
|
if let previousState = self.previousState {
|
|
encoder.encodeObject(previousState, forKey: "p")
|
|
} else {
|
|
encoder.encodeNil(forKey: "p")
|
|
}
|
|
}
|
|
}
|