aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-03-26 15:48:20 +0000
committerLibravatar cel 🌸 <cel@bunny.garden>2025-03-26 15:48:20 +0000
commit4d1be876f8bccf8018728d5ee474f91c256da5c9 (patch)
tree87bd55596221246e31b2f13942ce82f1014b146a
parentbf677e1f9ce07e2fa8971c15b9a082cddbb40dec (diff)
downloadluz-4d1be876f8bccf8018728d5ee474f91c256da5c9.tar.gz
luz-4d1be876f8bccf8018728d5ee474f91c256da5c9.tar.bz2
luz-4d1be876f8bccf8018728d5ee474f91c256da5c9.zip
feat(stanza): feature-gate rfc 6121 jabber:iq:roster
-rw-r--r--filamento/Cargo.toml2
-rw-r--r--stanza/Cargo.toml1
-rw-r--r--stanza/src/client/iq.rs7
-rw-r--r--stanza/src/lib.rs1
4 files changed, 9 insertions, 2 deletions
diff --git a/filamento/Cargo.toml b/filamento/Cargo.toml
index e25024a..821a6a0 100644
--- a/filamento/Cargo.toml
+++ b/filamento/Cargo.toml
@@ -8,7 +8,7 @@ futures = "0.3.31"
lampada = { version = "0.1.0", path = "../lampada" }
tokio = "1.42.0"
thiserror = "2.0.11"
-stanza = { version = "0.1.0", path = "../stanza", features = ["xep_0203"] }
+stanza = { version = "0.1.0", path = "../stanza", features = ["rfc_6121", "xep_0203"] }
sqlx = { version = "0.8.3", features = ["sqlite", "runtime-tokio", "uuid", "chrono"] }
# TODO: re-export jid?
jid = { version = "0.1.0", path = "../jid", features = ["sqlx"] }
diff --git a/stanza/Cargo.toml b/stanza/Cargo.toml
index 2794d22..e721a86 100644
--- a/stanza/Cargo.toml
+++ b/stanza/Cargo.toml
@@ -10,6 +10,7 @@ thiserror = "2.0.11"
chrono = { version = "0.4.40", optional = true }
[features]
+rfc_6121 = []
xep_0030 = []
xep_0199 = []
xep_0203 = ["dep:chrono"]
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!(),
diff --git a/stanza/src/lib.rs b/stanza/src/lib.rs
index 85bce52..9585353 100644
--- a/stanza/src/lib.rs
+++ b/stanza/src/lib.rs
@@ -2,6 +2,7 @@ use peanuts::declaration::VersionInfo;
pub mod bind;
pub mod client;
+#[cfg(feature = "rfc_6121")]
pub mod roster;
pub mod sasl;
pub mod stanza_error;