From 911b6867787fc79c878064dbf7db9cfa078b1144 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Thu, 20 Jun 2024 18:29:31 +0200 Subject: [PATCH] fixed bug in send method * allow sending messages to the sourceUuid see #550 --- src/client/client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/client.go b/src/client/client.go index 05310e9..335a68b 100644 --- a/src/client/client.go +++ b/src/client/client.go @@ -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 }