use serde::{Deserialize, Serialize}; use crate::{channels::ChannelReference, message_ast::MessageContent}; #[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Hash)] pub enum MessageReference { Discord(u64, u64), Matrix(String, String), } pub struct MessageAuthor { pub display_name: String, pub avatar_url: String, pub service_name: String, } pub struct SentMessage { pub source: MessageReference, pub content: MessageContent, pub author: MessageAuthor, pub replies_to: Option, } pub struct EditedMessage { pub replacing: MessageReference, pub content: MessageContent, pub author: MessageAuthor, } pub struct DeletedMessage { pub reference: MessageReference, } pub enum MessageEvent { AdminLinkChannels(Vec), Send(SentMessage), Edit(EditedMessage), Delete(DeletedMessage), }