daemon: maintain outgoing message reference so model is consistent
This commit is contained in:
@@ -2,6 +2,9 @@ use tokio::sync::oneshot;
|
||||
use uuid::Uuid;
|
||||
|
||||
use kordophone_db::models::{Conversation, Message};
|
||||
use kordophone::model::ConversationID;
|
||||
use kordophone::model::OutgoingMessage;
|
||||
|
||||
use crate::daemon::settings::Settings;
|
||||
|
||||
pub type Reply<T> = oneshot::Sender<T>;
|
||||
@@ -45,6 +48,13 @@ pub enum Event {
|
||||
/// - reply: The outgoing message ID (not the server-assigned message ID).
|
||||
SendMessage(String, String, Reply<Uuid>),
|
||||
|
||||
/// Notifies the daemon that a message has been sent.
|
||||
/// Parameters:
|
||||
/// - message: The message that was sent.
|
||||
/// - outgoing_message: The outgoing message that was sent.
|
||||
/// - conversation_id: The ID of the conversation that the message was sent to.
|
||||
MessageSent(Message, OutgoingMessage, ConversationID),
|
||||
|
||||
/// Delete all conversations from the database.
|
||||
DeleteAllConversations(Reply<()>),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user