Skip to content
Snippets Groups Projects
Commit 6a0f4fb6 authored by Josh Brooks's avatar Josh Brooks
Browse files

Add request deletion to CLI

parent 7856acdc
Branches
Tags
2 merge requests!170Release,!147Implement Delete requests functions for auth store
...@@ -304,6 +304,18 @@ var rootCmd = &cobra.Command{ ...@@ -304,6 +304,18 @@ var rootCmd = &cobra.Command{
deleteChannel(client, recipientID) deleteChannel(client, recipientID)
} }
if viper.GetBool("delete-receive-requests") {
client.DeleteReceiveRequests()
}
if viper.GetBool("delete-sent-requests") {
client.DeleteSentRequests()
}
if viper.GetBool("delete-all-requests") {
client.DeleteAllRequests()
}
msg := message.Send{ msg := message.Send{
Recipient: recipientID, Recipient: recipientID,
Payload: []byte(msgBody), Payload: []byte(msgBody),
...@@ -1030,6 +1042,21 @@ func init() { ...@@ -1030,6 +1042,21 @@ func init() {
viper.BindPFlag("delete-channel", viper.BindPFlag("delete-channel",
rootCmd.PersistentFlags().Lookup("delete-channel")) rootCmd.PersistentFlags().Lookup("delete-channel"))
rootCmd.PersistentFlags().Bool("delete-receive-requests", false,
"Delete the all received contact requests.")
viper.BindPFlag("delete-receive-requests",
rootCmd.PersistentFlags().Lookup("delete-receive-requests"))
rootCmd.PersistentFlags().Bool("delete-sent-requests", false,
"Delete the all sent contact requests.")
viper.BindPFlag("delete-sent-requests",
rootCmd.PersistentFlags().Lookup("delete-sent-requests"))
rootCmd.PersistentFlags().Bool("delete-all-requests", false,
"Delete the all contact requests, both sent and received.")
viper.BindPFlag("delete-all-requests",
rootCmd.PersistentFlags().Lookup("delete-all-requests"))
rootCmd.Flags().BoolP("send-auth-request", "", false, rootCmd.Flags().BoolP("send-auth-request", "", false,
"Send an auth request to the specified destination and wait"+ "Send an auth request to the specified destination and wait"+
"for confirmation") "for confirmation")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment