fixed bug in send method

* allow sending messages to the sourceUuid

see #550
This commit is contained in:
Bernhard B
2024-06-20 18:29:31 +02:00
parent f444622397
commit 911b686778

View File

@@ -315,6 +315,14 @@ func getRecipientType(s string) (ds.RecpType, error) {
return ds.Group, errors.New("Invalid identifier " + s) return ds.Group, errors.New("Invalid identifier " + s)
} else if utils.IsPhoneNumber(s) { } else if utils.IsPhoneNumber(s) {
return ds.Number, nil 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 return ds.Username, nil
} }