1use tokio_xmpp::{
8 jid::Jid,
9 minidom::Element,
10 parsers::{
11 iq::Iq,
12 stanza_error::{DefinedCondition, ErrorType, StanzaError},
13 },
14};
15
16use crate::{Agent, Event};
17
18pub async fn handle_iq_set(
19 agent: &mut Agent,
20 _events: &mut Vec<Event>,
21 from: Jid,
22 _to: Option<Jid>,
23 id: String,
24 _payload: Element,
25) {
26 let error = StanzaError::new(
28 ErrorType::Cancel,
29 DefinedCondition::ServiceUnavailable,
30 "en",
31 "No handler defined for this kind of iq.",
32 );
33 let iq = Iq::from_error(id, error).with_to(from).into();
34 let _ = agent.client.send_stanza(iq).await;
35}