Update bookmarks2 NS to urn:xmpp:bookmarks:1

This commit is contained in:
Paul Fariello 2020-09-29 18:12:18 +02:00
parent c3783a77b6
commit 76db2ae117
2 changed files with 5 additions and 5 deletions

View file

@ -63,7 +63,7 @@ mod tests {
#[test] #[test]
fn simple() { fn simple() {
let elem: Element = "<conference xmlns='urn:xmpp:bookmarks:0'/>" let elem: Element = "<conference xmlns='urn:xmpp:bookmarks:1'/>"
.parse() .parse()
.unwrap(); .unwrap();
let elem1 = elem.clone(); let elem1 = elem.clone();
@ -79,7 +79,7 @@ mod tests {
#[test] #[test]
fn complete() { fn complete() {
let elem: Element = "<conference xmlns='urn:xmpp:bookmarks:0' autojoin='true' name='Test MUC'><nick>Coucou</nick><password>secret</password></conference>".parse().unwrap(); let elem: Element = "<conference xmlns='urn:xmpp:bookmarks:1' autojoin='true' name='Test MUC'><nick>Coucou</nick><password>secret</password></conference>".parse().unwrap();
let conference = Conference::try_from(elem).unwrap(); let conference = Conference::try_from(elem).unwrap();
assert_eq!(conference.autojoin, Autojoin::True); assert_eq!(conference.autojoin, Autojoin::True);
assert_eq!(conference.name, Some(String::from("Test MUC"))); assert_eq!(conference.name, Some(String::from("Test MUC")));
@ -89,7 +89,7 @@ mod tests {
#[test] #[test]
fn wrapped() { fn wrapped() {
let elem: Element = "<item xmlns='http://jabber.org/protocol/pubsub' id='test-muc@muc.localhost'><conference xmlns='urn:xmpp:bookmarks:0' autojoin='true' name='Test MUC'><nick>Coucou</nick><password>secret</password></conference></item>".parse().unwrap(); let elem: Element = "<item xmlns='http://jabber.org/protocol/pubsub' id='test-muc@muc.localhost'><conference xmlns='urn:xmpp:bookmarks:1' autojoin='true' name='Test MUC'><nick>Coucou</nick><password>secret</password></conference></item>".parse().unwrap();
let item = PubSubItem::try_from(elem).unwrap(); let item = PubSubItem::try_from(elem).unwrap();
let payload = item.payload.clone().unwrap(); let payload = item.payload.clone().unwrap();
println!("FOO: payload: {:?}", payload); println!("FOO: payload: {:?}", payload);
@ -102,7 +102,7 @@ mod tests {
assert_eq!(conference.clone().nick.unwrap(), "Coucou"); assert_eq!(conference.clone().nick.unwrap(), "Coucou");
assert_eq!(conference.clone().password.unwrap(), "secret"); assert_eq!(conference.clone().password.unwrap(), "secret");
let elem: Element = "<event xmlns='http://jabber.org/protocol/pubsub#event'><items node='urn:xmpp:bookmarks:0'><item xmlns='http://jabber.org/protocol/pubsub#event' id='test-muc@muc.localhost'><conference xmlns='urn:xmpp:bookmarks:0' autojoin='true' name='Test MUC'><nick>Coucou</nick><password>secret</password></conference></item></items></event>".parse().unwrap(); let elem: Element = "<event xmlns='http://jabber.org/protocol/pubsub#event'><items node='urn:xmpp:bookmarks:1'><item xmlns='http://jabber.org/protocol/pubsub#event' id='test-muc@muc.localhost'><conference xmlns='urn:xmpp:bookmarks:1' autojoin='true' name='Test MUC'><nick>Coucou</nick><password>secret</password></conference></item></items></event>".parse().unwrap();
let mut items = match PubSubEvent::try_from(elem) { let mut items = match PubSubEvent::try_from(elem) {
Ok(PubSubEvent::PublishedItems { node, items }) => { Ok(PubSubEvent::PublishedItems { node, items }) => {
assert_eq!(&node.0, ns::BOOKMARKS2); assert_eq!(&node.0, ns::BOOKMARKS2);

View file

@ -238,7 +238,7 @@ pub const ECAPS2: &str = "urn:xmpp:caps";
pub const ECAPS2_OPTIMIZE: &str = "urn:xmpp:caps:optimize"; pub const ECAPS2_OPTIMIZE: &str = "urn:xmpp:caps:optimize";
/// XEP-0402: Bookmarks 2 (This Time it's Serious) /// XEP-0402: Bookmarks 2 (This Time it's Serious)
pub const BOOKMARKS2: &str = "urn:xmpp:bookmarks:0"; pub const BOOKMARKS2: &str = "urn:xmpp:bookmarks:1";
/// XEP-0402: Bookmarks 2 (This Time it's Serious) /// XEP-0402: Bookmarks 2 (This Time it's Serious)
pub const BOOKMARKS2_COMPAT: &str = "urn:xmpp:bookmarks:0#compat"; pub const BOOKMARKS2_COMPAT: &str = "urn:xmpp:bookmarks:0#compat";