package com.rosetta.messenger.domain.chats.usecase

import com.rosetta.messenger.di.ProtocolGateway
import com.rosetta.messenger.network.PacketRead
import javax.inject.Inject

data class SendReadReceiptCommand(
    val privateKeyHash: String,
    val fromPublicKey: String,
    val toPublicKey: String
)

class SendReadReceiptUseCase @Inject constructor(
    private val protocolGateway: ProtocolGateway
) {
    operator fun invoke(command: SendReadReceiptCommand) {
        val packet =
            PacketRead().apply {
                privateKey = command.privateKeyHash
                fromPublicKey = command.fromPublicKey
                toPublicKey = command.toPublicKey
            }
        protocolGateway.send(packet)
    }
}
