Move handle_upload_result to upload module

This commit is contained in:
xmppftw xmppftw 2023-12-29 18:29:22 +01:00 committed by xmppftw@kl.netlib.re
commit b4caea19d4
3 changed files with 69 additions and 54 deletions

View file

@ -13,7 +13,7 @@ use tokio_xmpp::parsers::{
stanza_error::{DefinedCondition, ErrorType, StanzaError},
};
use crate::{handle_upload_result, pubsub, Agent, Event};
use crate::{pubsub, upload, Agent, Event};
pub async fn handle_iq(agent: &mut Agent, iq: Iq) -> Vec<Event> {
let mut events = vec![];
@ -71,7 +71,7 @@ pub async fn handle_iq(agent: &mut Agent, iq: Iq) -> Vec<Event> {
let new_events = pubsub::handle_iq_result(&from, payload);
events.extend(new_events);
} else if payload.is("slot", ns::HTTP_UPLOAD) {
let new_events = handle_upload_result(&from, iq.id, payload, agent).await;
let new_events = upload::handle_upload_result(&from, iq.id, payload, agent).await;
events.extend(new_events);
} else if payload.is("query", ns::PRIVATE) {
match PrivateXMLQuery::try_from(payload) {