mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Thread draft synchronization
This commit is contained in:
@@ -2,13 +2,16 @@ import Postbox
|
||||
|
||||
public final class SynchronizeChatInputStateOperation: PostboxCoding {
|
||||
public let previousState: SynchronizeableChatInputState?
|
||||
public let threadId: Int64?
|
||||
|
||||
public init(previousState: SynchronizeableChatInputState?) {
|
||||
public init(previousState: SynchronizeableChatInputState?, threadId: Int64?) {
|
||||
self.previousState = previousState
|
||||
self.threadId = threadId
|
||||
}
|
||||
|
||||
public init(decoder: PostboxDecoder) {
|
||||
self.previousState = decoder.decode(SynchronizeableChatInputState.self, forKey: "p")
|
||||
self.threadId = decoder.decodeOptionalInt64ForKey("threadId")
|
||||
}
|
||||
|
||||
public func encode(_ encoder: PostboxEncoder) {
|
||||
@@ -17,5 +20,10 @@ public final class SynchronizeChatInputStateOperation: PostboxCoding {
|
||||
} else {
|
||||
encoder.encodeNil(forKey: "p")
|
||||
}
|
||||
if let threadId = self.threadId {
|
||||
encoder.encodeInt64(threadId, forKey: "threadId")
|
||||
} else {
|
||||
encoder.encodeNil(forKey: "threadId")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user