aboutsummaryrefslogtreecommitdiffstats
path: root/src/stanza/client/presence.rs
blob: 46194f384f0762756be63afc77a2f46131b1f99f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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);