aboutsummaryrefslogtreecommitdiffstats
path: root/src/stanza/client/message.rs
blob: cdfda5dfb713cbf464a13adcad605aa7333a7b18 (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
use crate::JID;

pub struct Message {
    from: Option<JID>,
    id: Option<String>,
    to: Option<JID>,
    r#type: Option<MessageType>,
    // children
    subject: Option<Subject>,
    body: Option<Body>,
    thread: Option<Thread>,
    lang: Option<String>,
}

pub enum MessageType {
    Chat,
    Error,
    Groupchat,
    Headline,
    Normal,
}

pub struct Body {
    lang: Option<String>,
    body: Option<String>,
}

pub struct Subject {
    lang: Option<String>,
    subject: Option<String>,
}

pub struct Thread {
    // TODO: NOT DONE
    parent: Option<String>,
    thread: Option<String>,
}