diff --git a/cmd/root.go b/cmd/root.go index 6a8329f13d4f37c85dd2ac680d147168baffab06..469b227d36d7e16fc60f1d189afc3c06c59ae5ce 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -157,12 +157,6 @@ var rootCmd = &cobra.Command{ authConfirmed = true } - // Delete this recipient - if viper.GetBool("delete-channel") { - jww.FATAL.Printf("Deleting contact with ID %s", recipientID) - deleteChannel(client, recipientID) - } - if client.HasAuthenticatedChannel(recipientID) { jww.INFO.Printf("Authenticated channel already in "+ "place for %s", recipientID) @@ -202,6 +196,12 @@ var rootCmd = &cobra.Command{ " took %d seconds", scnt) } + // Delete this recipient + if viper.GetBool("delete-channel") { + jww.FATAL.Printf("Deleting contact with ID %s", recipientID) + deleteChannel(client, recipientID) + } + msg := message.Send{ Recipient: recipientID, Payload: []byte(msgBody),