aboutsummaryrefslogtreecommitdiffstats
path: root/stanza/src/client/presence.rs
diff options
context:
space:
mode:
Diffstat (limited to 'stanza/src/client/presence.rs')
-rw-r--r--stanza/src/client/presence.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/stanza/src/client/presence.rs b/stanza/src/client/presence.rs
index bffb0d0..a8c35d0 100644
--- a/stanza/src/client/presence.rs
+++ b/stanza/src/client/presence.rs
@@ -6,6 +6,8 @@ use peanuts::{
DeserializeError, Element, XML_NS,
};
+#[cfg(feature = "xep_0115")]
+use crate::xep_0115::C;
#[cfg(feature = "xep_0131")]
use crate::xep_0131::Headers;
#[cfg(feature = "xep_0172")]
@@ -32,6 +34,8 @@ pub struct Presence {
pub headers: Option<Headers>,
#[cfg(feature = "xep_0172")]
pub nick: Option<Nick>,
+ #[cfg(feature = "xep_0115")]
+ pub c: Option<C>,
// ##other
pub errors: Vec<Error>,
}
@@ -61,6 +65,9 @@ impl FromElement for Presence {
#[cfg(feature = "xep_0172")]
let nick = element.child_opt()?;
+ #[cfg(feature = "xep_0115")]
+ let c = element.child_opt()?;
+
Ok(Presence {
from,
id,
@@ -77,6 +84,8 @@ impl FromElement for Presence {
headers,
#[cfg(feature = "xep_0172")]
nick,
+ #[cfg(feature = "xep_0115")]
+ c,
})
}
}
@@ -103,6 +112,9 @@ impl IntoElement for Presence {
#[cfg(feature = "xep_0172")]
let builder = builder.push_child_opt(self.nick.clone());
+ #[cfg(feature = "xep_0115")]
+ let builder = builder.push_child_opt(self.c.clone());
+
builder
}
}