Private
Public Access
1
0

daemon: add support for getting messages from db

This commit is contained in:
2025-04-28 16:00:04 -07:00
parent 9c245a5b52
commit c189e5f9e3
11 changed files with 267 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
use tokio::sync::oneshot;
use kordophone_db::models::Conversation;
use kordophone_db::models::{Conversation, Message};
use crate::daemon::settings::Settings;
pub type Reply<T> = oneshot::Sender<T>;
@@ -20,6 +20,12 @@ pub enum Event {
/// Update settings in the database.
UpdateSettings(Settings, Reply<()>),
/// Returns all messages for a conversation from the database.
/// Parameters:
/// - conversation_id: The ID of the conversation to get messages for.
/// - 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>>),
}