diff --git a/tokio-xmpp/ChangeLog b/tokio-xmpp/ChangeLog index ff95d083..c2eb377f 100644 --- a/tokio-xmpp/ChangeLog +++ b/tokio-xmpp/ChangeLog @@ -5,6 +5,9 @@ Version NEXT: new default. The newly-introduced `pedantic` feature can be used to opt into the previous default behaviour of rejecting all unknown child elements and attributes. + * Breaking: + - Add `xmpp_parsers::stream_features::StreamFeatures` to + `tokio_xmpp::event::Online` (!631) * Added: - Expose `client_auth` method to allow manual stream setups for advanced use cases. diff --git a/tokio-xmpp/src/client/stream.rs b/tokio-xmpp/src/client/stream.rs index 6057ecef..cd324509 100644 --- a/tokio-xmpp/src/client/stream.rs +++ b/tokio-xmpp/src/client/stream.rs @@ -46,7 +46,7 @@ impl Stream for Client { bound_jid, features, })) => { - self.features = Some(features); + self.features = Some(features.clone()); self.bound_jid = Some(bound_jid.clone()); self.iq_response_tracker @@ -54,11 +54,13 @@ impl Stream for Client { Some(Event::Online { bound_jid, + features, resumed: false, }) } Some(StanzaStreamEvent::Stream(StreamEvent::Resumed)) => Some(Event::Online { bound_jid: self.bound_jid.as_ref().unwrap().clone(), + features: self.features.as_ref().unwrap().clone(), resumed: true, }), Some(StanzaStreamEvent::Stream(StreamEvent::Suspended)) => continue, diff --git a/tokio-xmpp/src/event.rs b/tokio-xmpp/src/event.rs index 347374f4..da9d8eca 100644 --- a/tokio-xmpp/src/event.rs +++ b/tokio-xmpp/src/event.rs @@ -9,6 +9,7 @@ use xmpp_parsers::{ jid::Jid, message::{Id, Message}, presence::Presence, + stream_features::StreamFeatures, }; use xso::{AsXml, FromXml}; @@ -125,6 +126,8 @@ pub enum Event { /// expected, so use this one instead of the JID with which /// the connection was setup. bound_jid: Jid, + /// Features supported by the server + features: StreamFeatures, /// Was this session resumed? /// /// Not yet implemented for the Client