xmpp: Adapt to xmpp-parsers changes wrt autojoin

Emmanuel Gil Peyrot created

This attribute is now a simple bool instead of an enum.

Change summary

parsers/ChangeLog      |  4 +++-
xmpp/src/pubsub/mod.rs | 10 ++++------
2 files changed, 7 insertions(+), 7 deletions(-)

Detailed changes

parsers/ChangeLog 🔗

@@ -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

xmpp/src/pubsub/mod.rs 🔗

@@ -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));
                             }
                         }