From 4d1be876f8bccf8018728d5ee474f91c256da5c9 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Wed, 26 Mar 2025 15:48:20 +0000 Subject: feat(stanza): feature-gate rfc 6121 jabber:iq:roster --- stanza/src/client/iq.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'stanza/src/client/iq.rs') diff --git a/stanza/src/client/iq.rs b/stanza/src/client/iq.rs index 41f87fd..6d0c671 100644 --- a/stanza/src/client/iq.rs +++ b/stanza/src/client/iq.rs @@ -9,9 +9,11 @@ use peanuts::{ use crate::{ bind::{self, Bind}, client::error::Error, - roster, }; +#[cfg(feature = "rfc_6121")] +use crate::roster; + #[cfg(feature = "xep_0030")] use crate::xep_0030::{self, info, items}; @@ -42,6 +44,7 @@ pub enum Query { DiscoItems(items::Query), #[cfg(feature = "xep_0199")] Ping(Ping), + #[cfg(feature = "rfc_6121")] Roster(roster::Query), Unsupported, } @@ -52,6 +55,7 @@ impl FromElement for Query { (Some(bind::XMLNS), "bind") => Ok(Query::Bind(Bind::from_element(element)?)), #[cfg(feature = "xep_0199")] (Some(xep_0199::XMLNS), "ping") => Ok(Query::Ping(Ping::from_element(element)?)), + #[cfg(feature = "rfc_6121")] (Some(roster::XMLNS), "query") => { Ok(Query::Roster(roster::Query::from_element(element)?)) } @@ -74,6 +78,7 @@ impl IntoElement for Query { Query::Bind(bind) => bind.builder(), #[cfg(feature = "xep_0199")] Query::Ping(ping) => ping.builder(), + #[cfg(feature = "rfc_6121")] Query::Roster(query) => query.builder(), // TODO: consider what to do if attempt to serialize unsupported Query::Unsupported => todo!(), -- cgit