mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-17 11:00:07 +00:00
23 lines
511 B
Swift
23 lines
511 B
Swift
import Foundation
|
|
#if os(macOS)
|
|
import PostboxMac
|
|
#else
|
|
import Postbox
|
|
#endif
|
|
|
|
public class ConsumableContentMessageAttribute: MessageAttribute {
|
|
public let consumed: Bool
|
|
|
|
public init(consumed: Bool) {
|
|
self.consumed = consumed
|
|
}
|
|
|
|
required public init(decoder: Decoder) {
|
|
self.consumed = (decoder.decodeInt32ForKey("c") as Int32) != 0
|
|
}
|
|
|
|
public func encode(_ encoder: Encoder) {
|
|
encoder.encodeInt32(self.consumed ? 1 : 0, forKey: "c")
|
|
}
|
|
}
|