xmpp: Adapt to xmpp-parsers changes wrt autojoin
This attribute is now a simple bool instead of an enum.
This commit is contained in:
parent
866991bda5
commit
011585594f
2 changed files with 7 additions and 7 deletions
|
|
@ -29,7 +29,9 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
|
||||||
`Option<Extensions>` instead of a `Vec<Element>`, to distinguish
|
`Option<Extensions>` instead of a `Vec<Element>`, to distinguish
|
||||||
between it being absent or empty (!472).
|
between it being absent or empty (!472).
|
||||||
- Replace all boolean attributes with the `bool` type, so that we can
|
- 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:
|
* Improvements:
|
||||||
- Keep unsupported vCard elements as `minidom::Element`, so that they
|
- Keep unsupported vCard elements as `minidom::Element`, so that they
|
||||||
get serialized back instead of being dropped. We now also test for
|
get serialized back instead of being dropped. We now also test for
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,8 @@ use tokio_xmpp::{
|
||||||
jid::{BareJid, Jid},
|
jid::{BareJid, Jid},
|
||||||
minidom::Element,
|
minidom::Element,
|
||||||
parsers::{
|
parsers::{
|
||||||
bookmarks2::{self, Autojoin},
|
bookmarks2, ns,
|
||||||
ns,
|
pubsub::{event::PubSubEvent, pubsub::PubSub},
|
||||||
pubsub::event::PubSubEvent,
|
|
||||||
pubsub::pubsub::PubSub,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -47,7 +45,7 @@ pub(crate) async fn handle_event<C: ServerConnector>(
|
||||||
let payload = item.payload.clone().unwrap();
|
let payload = item.payload.clone().unwrap();
|
||||||
match bookmarks2::Conference::try_from(payload) {
|
match bookmarks2::Conference::try_from(payload) {
|
||||||
Ok(conference) => {
|
Ok(conference) => {
|
||||||
if conference.autojoin == Autojoin::True {
|
if conference.autojoin {
|
||||||
events.push(Event::JoinRoom(jid, conference));
|
events.push(Event::JoinRoom(jid, conference));
|
||||||
} else {
|
} else {
|
||||||
events.push(Event::LeaveRoom(jid));
|
events.push(Event::LeaveRoom(jid));
|
||||||
|
|
@ -110,7 +108,7 @@ pub(crate) fn handle_iq_result(
|
||||||
let payload = item.payload.clone().unwrap();
|
let payload = item.payload.clone().unwrap();
|
||||||
match bookmarks2::Conference::try_from(payload) {
|
match bookmarks2::Conference::try_from(payload) {
|
||||||
Ok(conference) => {
|
Ok(conference) => {
|
||||||
if let Autojoin::True = conference.autojoin {
|
if conference.autojoin {
|
||||||
events.push(Event::JoinRoom(jid, conference));
|
events.push(Event::JoinRoom(jid, conference));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue