Private
Public Access
1
0

first attempt: notification code is in dbus::agent

This commit is contained in:
2025-11-01 21:39:53 -07:00
parent e650cffde7
commit 717138b371
15 changed files with 1222 additions and 120 deletions

View File

@@ -32,6 +32,7 @@ pub trait DaemonInterface {
async fn download_attachment(&mut self, attachment_id: String) -> Result<()>;
async fn upload_attachment(&mut self, path: String) -> Result<()>;
async fn mark_conversation_as_read(&mut self, conversation_id: String) -> Result<()>;
async fn test_notification(&mut self, summary: String, body: String) -> Result<()>;
}
struct StubDaemonInterface;
@@ -112,6 +113,11 @@ impl DaemonInterface for StubDaemonInterface {
"Daemon interface not implemented on this platform"
))
}
async fn test_notification(&mut self, _summary: String, _body: String) -> Result<()> {
Err(anyhow::anyhow!(
"Daemon interface not implemented on this platform"
))
}
}
pub fn new_daemon_interface() -> Result<Box<dyn DaemonInterface>> {
@@ -175,6 +181,9 @@ pub enum Commands {
/// Marks a conversation as read.
MarkConversationAsRead { conversation_id: String },
/// Displays a test notification using the daemon.
TestNotification { summary: String, body: String },
}
#[derive(Subcommand)]
@@ -219,6 +228,9 @@ impl Commands {
Commands::MarkConversationAsRead { conversation_id } => {
client.mark_conversation_as_read(conversation_id).await
}
Commands::TestNotification { summary, body } => {
client.test_notification(summary, body).await
}
}
}
}