aboutsummaryrefslogtreecommitdiffstats
path: root/src/stanza/client/presence.rs
diff options
context:
space:
mode:
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);