aboutsummaryrefslogtreecommitdiffstats
path: root/stanza
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-04-03 13:50:51 +0100
committerLibravatar cel 🌸 <cel@bunny.garden>2025-04-03 13:50:51 +0100
commit20969bd8b9789c08303265ec263e02b5225348e6 (patch)
tree0f45ec5e42f350b4554a1e269973451b8efeca42 /stanza
parentf48642bbd5a210b68e60715b59b1f24cf2d77fea (diff)
downloadluz-20969bd8b9789c08303265ec263e02b5225348e6.tar.gz
luz-20969bd8b9789c08303265ec263e02b5225348e6.tar.bz2
luz-20969bd8b9789c08303265ec263e02b5225348e6.zip
feat(filamento): xep-0172: user nick
Diffstat (limited to 'stanza')
-rw-r--r--stanza/src/client/message.rs12
-rw-r--r--stanza/src/xep_0060/event.rs10
2 files changed, 17 insertions, 5 deletions
diff --git a/stanza/src/client/message.rs b/stanza/src/client/message.rs
index d94b82e..78258ca 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_0060")]
+use crate::xep_0060::event::Event;
#[cfg(feature = "xep_0131")]
use crate::xep_0131::Headers;
#[cfg(feature = "xep_0172")]
@@ -33,6 +35,8 @@ pub struct Message {
pub headers: Option<Headers>,
#[cfg(feature = "xep_0172")]
pub nick: Option<Nick>,
+ #[cfg(feature = "xep_0060")]
+ pub event: Option<Event>,
}
impl FromElement for Message {
@@ -59,6 +63,9 @@ impl FromElement for Message {
#[cfg(feature = "xep_0172")]
let nick = element.child_opt()?;
+ #[cfg(feature = "xep_0060")]
+ let event = element.child_opt()?;
+
Ok(Message {
from,
id,
@@ -74,6 +81,8 @@ impl FromElement for Message {
headers,
#[cfg(feature = "xep_0172")]
nick,
+ #[cfg(feature = "xep_0060")]
+ event,
})
}
}
@@ -105,6 +114,9 @@ impl IntoElement for Message {
#[cfg(feature = "xep_0172")]
let builder = builder.push_child_opt(self.nick.clone());
+ #[cfg(feature = "xep_0060")]
+ let builder = builder.push_child_opt(self.event.clone());
+
builder
}
}
diff --git a/stanza/src/xep_0060/event.rs b/stanza/src/xep_0060/event.rs
index d2c150a..4ef5a6c 100644
--- a/stanza/src/xep_0060/event.rs
+++ b/stanza/src/xep_0060/event.rs
@@ -219,8 +219,8 @@ impl IntoElement for Delete {
#[derive(Clone, Debug)]
pub struct Items {
- node: String,
- items: ItemsType,
+ pub node: String,
+ pub items: ItemsType,
}
impl FromElement for Items {
@@ -260,9 +260,9 @@ pub enum ItemsType {
#[derive(Clone, Debug)]
pub struct Item {
- id: Option<String>,
- publisher: Option<String>,
- item: Option<Content>,
+ pub id: Option<String>,
+ pub publisher: Option<String>,
+ pub item: Option<Content>,
}
impl FromElement for Item {