Skip to content

Commit

Permalink
fixed bug in send method
Browse files Browse the repository at this point in the history
* allow sending messages to the sourceUuid

see #550
  • Loading branch information
bbernhard committed Jun 20, 2024
1 parent f444622 commit 911b686
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@ func getRecipientType(s string) (ds.RecpType, error) {
return ds.Group, errors.New("Invalid identifier " + s)
} else if utils.IsPhoneNumber(s) {
return ds.Number, nil
} else {
//last but not least, check if it is a valid uuid.
//(although it is not directly exposed in the signal-cli manpage, signal-cli allows
//to send messages to the 'sourceUuid' (which is a UUID)
_, err := uuid.FromString(s)
if err == nil {
return ds.Number, nil
}
}
return ds.Username, nil
}
Expand Down

0 comments on commit 911b686

Please sign in to comment.