mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Refactor SyncCore
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user