mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-25 12:40:36 +00:00

git-subtree-dir: submodules/TelegramCore git-subtree-mainline: 971273e8f8f49a47f14b251d2f35e3445a61fc3f git-subtree-split: 9561227540acef69894e6546395ab223a6233600
23 lines
525 B
Swift
23 lines
525 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: PostboxDecoder) {
|
|
self.consumed = decoder.decodeInt32ForKey("c", orElse: 0) != 0
|
|
}
|
|
|
|
public func encode(_ encoder: PostboxEncoder) {
|
|
encoder.encodeInt32(self.consumed ? 1 : 0, forKey: "c")
|
|
}
|
|
}
|