Newer
Older
import Foundation
public struct Payload: Codable, Equatable, Hashable {
public var text: String
public var reply: Reply?
self.text = text
self.reply = reply
}
public init(with marshaled: Data) throws {
let proto = try CMIXText(serializedData: marshaled)
var reply: Reply?
if proto.hasReply {
reply = Reply(
messageId: proto.reply.messageID,
senderId: proto.reply.senderID
)
}