xmpp: Use tokio-xmpp’s reexports of jid and minidom

This commit is contained in:
Emmanuel Gil Peyrot 2024-07-24 20:52:10 +02:00 committed by Jonas Schäfer
parent e9b226e1ae
commit 5fc12c45b5
19 changed files with 35 additions and 21 deletions

View file

@ -6,7 +6,8 @@
use std::env::args;
use std::str::FromStr;
use tokio_xmpp::parsers::{message::MessageType, BareJid, Jid};
use tokio_xmpp::jid::{BareJid, Jid};
use tokio_xmpp::parsers::message::MessageType;
use xmpp::{ClientBuilder, ClientFeature, ClientType, Event};
#[tokio::main]

View file

@ -9,7 +9,11 @@ use std::sync::{Arc, RwLock};
use tokio_xmpp::connect::ServerConnector;
pub use tokio_xmpp::parsers;
use tokio_xmpp::parsers::{disco::DiscoInfoResult, message::MessageType};
pub use tokio_xmpp::{AsyncClient as TokioXmppClient, BareJid, Element, FullJid, Jid};
pub use tokio_xmpp::{
jid::{BareJid, FullJid, Jid},
minidom::Element,
AsyncClient as TokioXmppClient,
};
use crate::{event_loop, message, muc, upload, Error, Event, RoomNick};

View file

@ -7,11 +7,12 @@
use std::sync::{Arc, RwLock};
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::{BareJid, Jid},
parsers::{
disco::{DiscoInfoResult, Feature, Identity},
ns,
},
AsyncClient as TokioXmppClient, AsyncConfig, BareJid, Jid,
AsyncClient as TokioXmppClient, AsyncConfig,
};
use crate::{Agent, ClientFeature};

View file

@ -6,8 +6,8 @@
use chrono::{DateTime, Utc};
use tokio_xmpp::{
jid::Jid,
parsers::{delay::Delay, message::Message, ns},
Jid,
};
/// Time information associated with a stanza.

View file

@ -6,6 +6,7 @@
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::Jid,
parsers::{
bookmarks,
disco::DiscoInfoResult,
@ -14,7 +15,6 @@ use tokio_xmpp::{
private::Query as PrivateXMLQuery,
pubsub::pubsub::{Items, PubSub},
},
Jid,
};
use crate::Agent;

View file

@ -4,9 +4,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use tokio_xmpp::jid::BareJid;
#[cfg(feature = "avatars")]
use tokio_xmpp::parsers::Jid;
use tokio_xmpp::parsers::{bookmarks2, message::Body, roster::Item as RosterItem, BareJid};
use tokio_xmpp::jid::Jid;
use tokio_xmpp::parsers::{bookmarks2, message::Body, roster::Item as RosterItem};
use crate::{delay::StanzaTimeInfo, Error, Id, RoomNick};

View file

@ -6,13 +6,14 @@
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::Jid,
minidom::Element,
parsers::{
disco::DiscoInfoQuery,
iq::Iq,
ns,
stanza_error::{DefinedCondition, ErrorType, StanzaError},
},
Element, Jid,
};
use crate::{Agent, Event};

View file

@ -6,8 +6,9 @@
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::Jid,
minidom::Element,
parsers::{disco::DiscoInfoResult, ns, private::Query as PrivateXMLQuery, roster::Roster},
Element, Jid,
};
use crate::{disco, pubsub, upload, Agent, Event};

View file

@ -6,11 +6,12 @@
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::Jid,
minidom::Element,
parsers::{
iq::Iq,
stanza_error::{DefinedCondition, ErrorType, StanzaError},
},
Element, Jid,
};
use crate::{Agent, Event};

View file

@ -6,8 +6,9 @@
#![deny(bare_trait_objects)]
pub use tokio_xmpp::jid;
pub use tokio_xmpp::minidom;
pub use tokio_xmpp::parsers;
pub use tokio_xmpp::{BareJid, Element, FullJid, Jid};
#[macro_use]
extern crate log;
@ -37,7 +38,8 @@ pub type RoomNick = String;
#[cfg(all(test, any(feature = "starttls-rust", feature = "starttls-native")))]
mod tests {
use super::{BareJid, ClientBuilder, ClientFeature, ClientType, Event};
use super::jid::BareJid;
use super::{ClientBuilder, ClientFeature, ClientType, Event};
use std::str::FromStr;
use tokio_xmpp::AsyncClient as TokioXmppClient;

View file

@ -6,8 +6,8 @@
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::Jid,
parsers::{message::Message, muc::user::MucUser},
Jid,
};
use crate::{delay::StanzaTimeInfo, Agent, Event};

View file

@ -5,7 +5,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{parsers::message::Message, Jid};
use tokio_xmpp::{jid::Jid, parsers::message::Message};
use crate::{delay::StanzaTimeInfo, Agent, Event};

View file

@ -6,8 +6,8 @@
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::Jid,
parsers::message::{Body, Message, MessageType},
Jid,
};
use crate::Agent;

View file

@ -6,11 +6,11 @@
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::{BareJid, Jid},
parsers::{
message::{Body, Message, MessageType},
muc::user::MucUser,
},
BareJid, Jid,
};
use crate::{Agent, RoomNick};

View file

@ -6,11 +6,11 @@
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::BareJid,
parsers::{
muc::Muc,
presence::{Presence, Type as PresenceType},
},
BareJid,
};
use crate::{Agent, RoomNick};

View file

@ -12,13 +12,13 @@ use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::parsers::{
avatar::{Data, Metadata},
iq::Iq,
jid::Jid,
ns,
pubsub::{
event::Item,
pubsub::{Items, PubSub},
NodeName,
},
Jid,
};
pub(crate) async fn handle_metadata_pubsub_event<C: ServerConnector>(

View file

@ -9,12 +9,13 @@ use crate::Event;
use std::str::FromStr;
use tokio_xmpp::{
connect::ServerConnector,
jid::{BareJid, Jid},
minidom::Element,
parsers::{
bookmarks2::{self, Autojoin},
ns,
pubsub::event::PubSubEvent,
pubsub::pubsub::PubSub,
BareJid, Element, Jid,
},
};

View file

@ -12,8 +12,9 @@ use tokio::fs::File;
use tokio_util::codec::{BytesCodec, FramedRead};
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::Jid,
minidom::Element,
parsers::http_upload::{Header as HttpUploadHeader, SlotResult},
Element, Jid,
};
use crate::{Agent, Event};

View file

@ -8,8 +8,8 @@ use std::path::Path;
use tokio::fs::File;
use tokio_xmpp::connect::ServerConnector;
use tokio_xmpp::{
jid::Jid,
parsers::{http_upload::SlotRequest, iq::Iq},
Jid,
};
use crate::Agent;