xmpp crate now supports ServerConnector

This commit is contained in:
moparisthebest 2023-12-31 01:17:29 -05:00
commit 38bfba4a18
No known key found for this signature in database
GPG key ID: 88C93BFE27BC8229
20 changed files with 115 additions and 54 deletions

View file

@ -10,6 +10,7 @@ use reqwest::{
use std::path::PathBuf;
use tokio::fs::File;
use tokio_util::codec::{BytesCodec, FramedRead};
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
parsers::http_upload::{Header as HttpUploadHeader, SlotResult},
Element, Jid,
@ -17,11 +18,11 @@ use tokio_xmpp::{
use crate::{Agent, Event};
pub async fn handle_upload_result(
pub async fn handle_upload_result<C: ServerConnector>(
from: &Jid,
iqid: String,
elem: Element,
agent: &mut Agent,
agent: &mut Agent<C>,
) -> impl IntoIterator<Item = Event> {
let mut res: Option<(usize, PathBuf)> = None;