Private
Public Access
1
0

adds the ability to clear db

This commit is contained in:
2025-05-01 01:08:13 -07:00
parent fd4c43d585
commit 13a78ccd47
6 changed files with 53 additions and 0 deletions

View File

@@ -42,6 +42,9 @@ pub enum Commands {
conversation_id: String,
last_message_id: Option<String>,
},
/// Deletes all conversations.
DeleteAllConversations,
}
#[derive(Subcommand)]
@@ -75,6 +78,7 @@ impl Commands {
Commands::Config { command } => client.config(command).await,
Commands::Signals => client.wait_for_signals().await,
Commands::Messages { conversation_id, last_message_id } => client.print_messages(conversation_id, last_message_id).await,
Commands::DeleteAllConversations => client.delete_all_conversations().await,
}
}
}
@@ -188,4 +192,8 @@ impl DaemonCli {
.map_err(|e| anyhow::anyhow!("Failed to set credential item: {}", e))
}
pub async fn delete_all_conversations(&mut self) -> Result<()> {
KordophoneRepository::delete_all_conversations(&self.proxy())
.map_err(|e| anyhow::anyhow!("Failed to delete all conversations: {}", e))
}
}