use tokio_xmpp::{
jid::Jid,
minidom::Element,
parsers::{
iq::Iq,
stanza_error::{DefinedCondition, ErrorType, StanzaError},
},
};
use crate::{Agent, Event};
pub async fn handle_iq_set(
agent: &mut Agent,
_events: &mut Vec<Event>,
from: Jid,
_to: Option<Jid>,
id: String,
_payload: Element,
) {
let error = StanzaError::new(
ErrorType::Cancel,
DefinedCondition::ServiceUnavailable,
"en",
"No handler defined for this kind of iq.",
);
let iq = Iq::from_error(id, error).with_to(from).into();
let _ = agent.client.send_stanza(iq).await;
}