Skip to content
Snippets Groups Projects
Commit 0121617b authored by Jake Taylor's avatar Jake Taylor
Browse files

adjust recipient logic for basic cmd executino

parent fd349fad
No related branches found
No related tags found
2 merge requests!510Release,!258Hotfix/integration fixes
......@@ -208,18 +208,18 @@ var rootCmd = &cobra.Command{
var recipientContact contact.Contact
var recipientID *id.ID
destFile := viper.GetString("destfile")
destId := viper.GetString("destid")
sendId := viper.GetString("sendid")
if destId == "0" || sendId == destId {
if destFile != "" {
recipientContact = readContact(destFile)
recipientID = recipientContact.ID
} else if destId == "0" || sendId == destId {
jww.INFO.Printf("Sending message to self")
recipientID = receptionIdentity.ID
recipientContact = receptionIdentity.GetContact()
} else if destId != "0" {
recipientContact = readContact()
recipientID = parseRecipient(destId)
} else {
recipientContact = readContact()
recipientID = recipientContact.ID
recipientID = parseRecipient(destId)
}
isPrecanPartner := isPrecanID(recipientID)
......
......@@ -87,8 +87,7 @@ func writeContact(c contact.Contact) {
}
}
func readContact() contact.Contact {
inputFilePath := viper.GetString("destfile")
func readContact(inputFilePath string) contact.Contact {
if inputFilePath == "" {
return contact.Contact{}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment