From be198ca15bbaf633c1535db5bae7091520546aed Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Mon, 2 Dec 2024 21:50:15 +0000 Subject: implement bind --- src/stanza/client/presence.rs | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/stanza/client/presence.rs (limited to 'src/stanza/client/presence.rs') diff --git a/src/stanza/client/presence.rs b/src/stanza/client/presence.rs new file mode 100644 index 0000000..46194f3 --- /dev/null +++ b/src/stanza/client/presence.rs @@ -0,0 +1,48 @@ +use peanuts::element::{FromElement, IntoElement}; + +use crate::JID; + +use super::error::Error; + +pub struct Presence { + from: Option, + id: Option, + to: Option, + r#type: PresenceType, + lang: Option, + // children + show: Option, + status: Option, + priority: Option, + errors: Vec, + // ##other + // content: Vec>, +} + +pub enum PresenceType { + Error, + Probe, + Subscribe, + Subscribed, + Unavailable, + Unsubscribe, + Unsubscribed, +} + +pub enum Show { + Away, + Chat, + Dnd, + Xa, +} + +pub struct Status { + lang: Option, + status: String1024, +} + +// minLength 1 maxLength 1024 +pub struct String1024(String); + +// xs:byte +pub struct Priority(u8); -- cgit