daemon: add support for getting messages from db
This commit is contained in:
@@ -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>>),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user