use super::traits::StanzaHandler;
use crate::client::Client;
use async_trait::async_trait;
use std::sync::Arc;
#[derive(Default)]
pub struct ReceiptHandler;
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
impl StanzaHandler for ReceiptHandler {
fn tag(&self) -> &'static str {
"receipt"
}
async fn handle(
&self,
client: Arc<Client>,
node: Arc<wacore_binary::OwnedNodeRef>,
_cancelled: &mut bool,
) -> bool {
client.handle_receipt(node).await;
true
}
}