diff options
author | 2024-12-02 21:50:15 +0000 | |
---|---|---|
committer | 2024-12-02 21:50:15 +0000 | |
commit | be198ca15bbaf633c1535db5bae7091520546aed (patch) | |
tree | e7c33435851c4421bfb950818b285a00e63d93a0 /src/stanza/client/presence.rs | |
parent | 859a19820d69eca5fca87fc01acad72a6355f97e (diff) | |
download | luz-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.rs | 48 |
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); |