aboutsummaryrefslogtreecommitdiffstats
path: root/stanza/src/client/iq.rs
diff options
context:
space:
mode:
Diffstat (limited to 'stanza/src/client/iq.rs')
-rw-r--r--stanza/src/client/iq.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/stanza/src/client/iq.rs b/stanza/src/client/iq.rs
index 478530a..f5cdf32 100644
--- a/stanza/src/client/iq.rs
+++ b/stanza/src/client/iq.rs
@@ -3,6 +3,8 @@ use std::str::FromStr;
use jid::JID;
use peanuts::{DeserializeError, Element, FromElement, IntoElement, XML_NS};
+#[cfg(feature = "xep_0280")]
+use crate::xep_0280::{self, Disable, Enable};
use crate::{
bind::{self, Bind},
client::error::Error,
@@ -53,6 +55,10 @@ pub enum Query {
Ping(Ping),
#[cfg(feature = "rfc_6121")]
Roster(roster::Query),
+ #[cfg(feature = "xep_0280")]
+ CarbonsEnable(Enable),
+ #[cfg(feature = "xep_0280")]
+ CarbonsDisable(Disable),
Unsupported,
}
@@ -80,6 +86,14 @@ impl FromElement for Query {
(Some(xep_0060::owner::XMLNS), "pubsub") => Ok(Query::PubsubOwner(
xep_0060::owner::Pubsub::from_element(element)?,
)),
+ #[cfg(feature = "xep_0280")]
+ (Some(xep_0280::XMLNS), "enable") => {
+ Ok(Query::CarbonsEnable(Enable::from_element(element)?))
+ }
+ #[cfg(feature = "xep_0280")]
+ (Some(xep_0280::XMLNS), "disable") => {
+ Ok(Query::CarbonsDisable(Disable::from_element(element)?))
+ }
_ => Ok(Query::Unsupported),
}
}
@@ -103,6 +117,10 @@ impl IntoElement for Query {
Query::Pubsub(pubsub) => pubsub.builder(),
#[cfg(feature = "xep_0060")]
Query::PubsubOwner(pubsub) => pubsub.builder(),
+ #[cfg(feature = "xep_0280")]
+ Query::CarbonsEnable(enable) => enable.builder(),
+ #[cfg(feature = "xep_0280")]
+ Query::CarbonsDisable(disable) => disable.builder(),
}
}
}