package com.rosetta.messenger.network

/**
 * Push Token packet (ID: 0x0A) - DEPRECATED
 * Старый формат, заменен на PacketPushNotification (0x10)
 */
class PacketPushToken : Packet() {
    var privateKey: String = ""
    var publicKey: String = ""
    var pushToken: String = ""
    var platform: String = "android" // "android" или "ios"

    override fun getPacketId(): Int = 0x0A

    override fun receive(stream: Stream) {
        privateKey = stream.readString()
        publicKey = stream.readString()
        pushToken = stream.readString()
        platform = stream.readString()
    }

    override fun send(): Stream {
        val stream = Stream()
        stream.writeInt16(getPacketId())
        stream.writeString(privateKey)
        stream.writeString(publicKey)
        stream.writeString(pushToken)
        stream.writeString(platform)
        return stream
    }
}
