38 lines
606 B
Rust
38 lines
606 B
Rust
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>,
|
|
}
|