Private
Public Access
1
0

daemon: implements post office

This commit is contained in:
2025-05-02 14:22:43 -07:00
parent 07b55f8615
commit 2519bc05ad
13 changed files with 234 additions and 48 deletions

View File

@@ -1,4 +1,6 @@
use tokio::sync::oneshot;
use uuid::Uuid;
use kordophone_db::models::{Conversation, Message};
use crate::daemon::settings::Settings;
@@ -33,6 +35,13 @@ pub enum Event {
/// - last_message_id: (optional) The ID of the last message to get. If None, all messages are returned.
GetMessages(String, Option<String>, Reply<Vec<Message>>),
/// Enqueues a message to be sent to the server.
/// Parameters:
/// - conversation_id: The ID of the conversation to send the message to.
/// - text: The text of the message to send.
/// - reply: The outgoing message ID (not the server-assigned message ID).
SendMessage(String, String, Reply<Uuid>),
/// Delete all conversations from the database.
DeleteAllConversations(Reply<()>),
}