Private
Public Access
1
0

daemon: maintain outgoing message reference so model is consistent

This commit is contained in:
2025-05-03 21:45:53 -07:00
parent 0d61b6f2d7
commit d843127c6d
8 changed files with 124 additions and 35 deletions

View File

@@ -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<()>),
}