phoebe/src/messages.rs

31 lines
638 B
Rust
Raw Normal View History

2021-09-12 02:59:13 +00:00
use serde::{Deserialize, Serialize};
use crate::message_ast::MessageContent;
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq)]
2021-09-12 02:59:13 +00:00
pub enum MessageReference {
Discord(u64, u64),
Matrix(String, String),
}
pub struct MessageAuthor {
pub display_name: String,
}
pub struct SentMessage {
pub source: MessageReference,
pub content: MessageContent,
pub author: MessageAuthor,
}
2021-09-13 02:08:35 +00:00
pub struct EditedMessage {
pub replacing: MessageReference,
pub content: MessageContent,
pub author: MessageAuthor,
}
pub enum MessageEvent {
Send(SentMessage),
Edit(EditedMessage),
}