whatsapp_rust/handlers/
iq.rs1use super::traits::StanzaHandler;
2use crate::client::Client;
3use async_trait::async_trait;
4use log::warn;
5use std::sync::Arc;
6use wacore::xml::DisplayableNode;
7use wacore_binary::node::Node;
8
9#[derive(Default)]
17pub struct IqHandler;
18
19impl IqHandler {
20 pub fn new() -> Self {
21 Self
22 }
23}
24
25#[async_trait]
26impl StanzaHandler for IqHandler {
27 fn tag(&self) -> &'static str {
28 "iq"
29 }
30
31 async fn handle(&self, client: Arc<Client>, node: &Node, _cancelled: &mut bool) -> bool {
32 if !client.handle_iq(node).await {
33 warn!(target: "Client", "Received unhandled IQ: {}", DisplayableNode(node));
34 }
35 true
36 }
37}