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

Add delete-channel flag

parent 736e0da9
No related branches found
No related tags found
1 merge request!23Release
......@@ -147,6 +147,11 @@ var rootCmd = &cobra.Command{
authConfirmed = true
}
// Delete this recipient
if viper.GetBool("delete-channel") {
deleteChannel(client, recipientID)
}
if client.HasAuthenticatedChannel(recipientID) {
jww.INFO.Printf("Authenticated channel already in "+
"place for %s", recipientID)
......@@ -420,6 +425,13 @@ func acceptChannel(client *api.Client, recipientID *id.ID) {
}
}
func deleteChannel(client *api.Client, partnerId *id.ID) {
err := client.DeleteContact(partnerId)
if err != nil {
jww.FATAL.Panicf("%+v", err)
}
}
func printChanRequest(requestor contact.Contact, message string) {
msg := fmt.Sprintf("Authentication channel request from: %s\n",
requestor.ID)
......@@ -748,6 +760,10 @@ func init() {
viper.BindPFlag("accept-channel",
rootCmd.Flags().Lookup("accept-channel"))
rootCmd.Flags().Bool("delete-channel", false,
"Delete the channel information for the corresponding recipient ID")
viper.BindPFlag("delete-channel", rootCmd.Flags().Lookup("delete-channel"))
rootCmd.Flags().BoolP("send-auth-request", "", false,
"Send an auth request to the specified destination and wait"+
"for confirmation")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment