aboutsummaryrefslogtreecommitdiffstats
path: root/stanza/src/client/message.rs
diff options
context:
space:
mode:
Diffstat (limited to 'stanza/src/client/message.rs')
-rw-r--r--stanza/src/client/message.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/stanza/src/client/message.rs b/stanza/src/client/message.rs
index 192390b..e521613 100644
--- a/stanza/src/client/message.rs
+++ b/stanza/src/client/message.rs
@@ -6,6 +6,8 @@ use peanuts::{
DeserializeError, Element, XML_NS,
};
+#[cfg(feature = "xep_0131")]
+use crate::xep_0131::Headers;
#[cfg(feature = "xep_0203")]
use crate::xep_0203::Delay;
@@ -25,6 +27,8 @@ pub struct Message {
pub thread: Option<Thread>,
#[cfg(feature = "xep_0203")]
pub delay: Option<Delay>,
+ #[cfg(feature = "xep_0131")]
+ pub headers: Option<Headers>,
}
impl FromElement for Message {
@@ -45,6 +49,9 @@ impl FromElement for Message {
#[cfg(feature = "xep_0203")]
let delay = element.child_opt()?;
+ #[cfg(feature = "xep_0131")]
+ let headers = element.child_opt()?;
+
Ok(Message {
from,
id,
@@ -56,6 +63,8 @@ impl FromElement for Message {
thread,
#[cfg(feature = "xep_0203")]
delay,
+ #[cfg(feature = "xep_0131")]
+ headers,
})
}
}
@@ -81,6 +90,9 @@ impl IntoElement for Message {
#[cfg(feature = "xep_0203")]
let builder = builder.push_child_opt(self.delay.clone());
+ #[cfg(feature = "xep_0131")]
+ let builder = builder.push_child_opt(self.headers.clone());
+
builder
}
}