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.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/stanza/src/client/message.rs b/stanza/src/client/message.rs
index 13ee6f1..66db921 100644
--- a/stanza/src/client/message.rs
+++ b/stanza/src/client/message.rs
@@ -11,6 +11,8 @@ use crate::xep_0131::Headers;
use crate::xep_0172::Nick;
#[cfg(feature = "xep_0203")]
use crate::xep_0203::Delay;
+#[cfg(feature = "xep_0280")]
+use crate::xep_0280::{Private, Received, Sent};
#[cfg(feature = "xep_0297")]
use crate::xep_0297::Forwarded;
@@ -38,6 +40,12 @@ pub struct Message {
pub event: Option<Event>,
#[cfg(feature = "xep_0297")]
pub forwarded: Option<Forwarded>,
+ #[cfg(feature = "xep_0280")]
+ pub sent: Option<Sent>,
+ #[cfg(feature = "xep_0280")]
+ pub received: Option<Received>,
+ #[cfg(feature = "xep_0280")]
+ pub private: Option<Private>,
}
impl FromElement for Message {
@@ -70,6 +78,15 @@ impl FromElement for Message {
#[cfg(feature = "xep_0297")]
let forwarded = element.child_opt()?;
+ #[cfg(feature = "xep_0280")]
+ let sent = element.child_opt()?;
+
+ #[cfg(feature = "xep_0280")]
+ let received = element.child_opt()?;
+
+ #[cfg(feature = "xep_0280")]
+ let private = element.child_opt()?;
+
Ok(Message {
from,
id,
@@ -89,6 +106,12 @@ impl FromElement for Message {
event,
#[cfg(feature = "xep_0297")]
forwarded,
+ #[cfg(feature = "xep_0280")]
+ sent,
+ #[cfg(feature = "xep_0280")]
+ received,
+ #[cfg(feature = "xep_0280")]
+ private,
})
}
}
@@ -126,6 +149,15 @@ impl IntoElement for Message {
#[cfg(feature = "xep_0297")]
let builder = builder.push_child_opt(self.forwarded.clone());
+ #[cfg(feature = "xep_0280")]
+ let builder = builder.push_child_opt(self.sent.clone());
+
+ #[cfg(feature = "xep_0280")]
+ let builder = builder.push_child_opt(self.received.clone());
+
+ #[cfg(feature = "xep_0280")]
+ let builder = builder.push_child_opt(self.private.clone());
+
builder
}
}