adds the ability to clear db
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user