aboutsummaryrefslogtreecommitdiffstats
path: root/src/stanza/client/presence.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2024-12-02 21:50:15 +0000
committerLibravatar cel 🌸 <cel@bunny.garden>2024-12-02 21:50:15 +0000
commitbe198ca15bbaf633c1535db5bae7091520546aed (patch)
treee7c33435851c4421bfb950818b285a00e63d93a0 /src/stanza/client/presence.rs
parent859a19820d69eca5fca87fc01acad72a6355f97e (diff)
downloadluz-be198ca15bbaf633c1535db5bae7091520546aed.tar.gz
luz-be198ca15bbaf633c1535db5bae7091520546aed.tar.bz2
luz-be198ca15bbaf633c1535db5bae7091520546aed.zip
implement bind
Diffstat (limited to 'src/stanza/client/presence.rs')
-rw-r--r--src/stanza/client/presence.rs48
1 files changed, 48 insertions, 0 deletions
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<JID>,
+ id: Option<String>,
+ to: Option<JID>,
+ r#type: PresenceType,
+ lang: Option<String>,
+ // children
+ show: Option<Show>,
+ status: Option<Status>,
+ priority: Option<Priority>,
+ errors: Vec<Error>,
+ // ##other
+ // content: Vec<Box<dyn AsElement>>,
+}
+
+pub enum PresenceType {
+ Error,
+ Probe,
+ Subscribe,
+ Subscribed,
+ Unavailable,
+ Unsubscribe,
+ Unsubscribed,
+}
+
+pub enum Show {
+ Away,
+ Chat,
+ Dnd,
+ Xa,
+}
+
+pub struct Status {
+ lang: Option<String>,
+ status: String1024,
+}
+
+// minLength 1 maxLength 1024
+pub struct String1024(String);
+
+// xs:byte
+pub struct Priority(u8);