xmpp: Adapt to xmpp-parsers changes wrt autojoin

This attribute is now a simple bool instead of an enum.
This commit is contained in:
Emmanuel Gil Peyrot 2024-12-15 19:11:00 +01:00 committed by xmpp ftw
commit 011585594f
2 changed files with 7 additions and 7 deletions

View file

@ -29,7 +29,9 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
`Option<Extensions>` instead of a `Vec<Element>`, to distinguish
between it being absent or empty (!472).
- Replace all boolean attributes with the `bool` type, so that we can
use them just like normal booleans (!476).
use them just like normal booleans. The following structs are deprecated:
pubsub::pubsub::Notify, bookmarks2::Autojoin, extdisco::Restricted,
fast::Tls0Rtt, legacy_omemo::IsPreKey, mam::Complete, sm::ResumeAttr (!476)
* Improvements:
- Keep unsupported vCard elements as `minidom::Element`, so that they
get serialized back instead of being dropped. We now also test for

View file

@ -12,10 +12,8 @@ use tokio_xmpp::{
jid::{BareJid, Jid},
minidom::Element,
parsers::{
bookmarks2::{self, Autojoin},
ns,
pubsub::event::PubSubEvent,
pubsub::pubsub::PubSub,
bookmarks2, ns,
pubsub::{event::PubSubEvent, pubsub::PubSub},
},
};
@ -47,7 +45,7 @@ pub(crate) async fn handle_event<C: ServerConnector>(
let payload = item.payload.clone().unwrap();
match bookmarks2::Conference::try_from(payload) {
Ok(conference) => {
if conference.autojoin == Autojoin::True {
if conference.autojoin {
events.push(Event::JoinRoom(jid, conference));
} else {
events.push(Event::LeaveRoom(jid));
@ -110,7 +108,7 @@ pub(crate) fn handle_iq_result(
let payload = item.payload.clone().unwrap();
match bookmarks2::Conference::try_from(payload) {
Ok(conference) => {
if let Autojoin::True = conference.autojoin {
if conference.autojoin {
events.push(Event::JoinRoom(jid, conference));
}
}