Replace tokio_xmpp::stream_features with parsers

This commit is contained in:
xmppftw xmppftw 2024-08-01 17:54:00 +02:00 committed by Link Mauve
commit b9fc15977b
8 changed files with 23 additions and 64 deletions

View file

@ -4,12 +4,11 @@ use std::mem::replace;
use std::pin::Pin;
use std::task::Context;
use tokio::task::JoinHandle;
use xmpp_parsers::{jid::Jid, ns};
use xmpp_parsers::{jid::Jid, ns, stream_features::StreamFeatures};
use super::connect::client_login;
use crate::connect::{AsyncReadAndWrite, ServerConnector};
use crate::event::Event;
use crate::stream_features::StreamFeatures;
use crate::xmpp_codec::Packet;
use crate::xmpp_stream::{add_stanza_id, XMPPStream};
use crate::{Error, ProtocolError};

View file

@ -23,7 +23,13 @@ pub async fn auth<S: AsyncRead + AsyncWrite + Unpin>(
Box::new(|| Box::new(Anonymous::new())),
];
let remote_mechs: HashSet<String> = stream.stream_features.sasl_mechanisms()?.collect();
let remote_mechs: HashSet<String> = stream
.stream_features
.sasl_mechanisms
.mechanisms
.iter()
.map(|item| item.mechanism.clone())
.collect();
for local_mech in local_mechs {
let mut mechanism = local_mech();

View file

@ -3,10 +3,9 @@ use minidom::Element;
use std::pin::Pin;
use std::task::{Context, Poll};
use tokio_stream::StreamExt;
use xmpp_parsers::{jid::Jid, ns};
use xmpp_parsers::{jid::Jid, ns, stream_features::StreamFeatures};
use crate::connect::ServerConnector;
use crate::stream_features::StreamFeatures;
use crate::xmpp_codec::Packet;
use crate::xmpp_stream::{add_stanza_id, XMPPStream};
use crate::Error;