Swiftgram/TelegramCore/OutgoingChatContextResultMessageAttribute.swift
2017-05-26 13:11:25 +03:00

27 lines
667 B
Swift

import Foundation
#if os(macOS)
import PostboxMac
#else
import Postbox
#endif
public class OutgoingChatContextResultMessageAttribute: MessageAttribute {
public let queryId: Int64
public let id: String
init(queryId: Int64, id: String) {
self.queryId = queryId
self.id = id
}
required public init(decoder: Decoder) {
self.queryId = decoder.decodeInt64ForKey("q", orElse: 0)
self.id = decoder.decodeStringForKey("i", orElse: "")
}
public func encode(_ encoder: Encoder) {
encoder.encodeInt64(self.queryId, forKey: "q")
encoder.encodeString(self.id, forKey: "i")
}
}