mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-05-25 14:34:22 +00:00
fixed bug in send method
* allow sending messages to the sourceUuid see #550
This commit is contained in:
parent
f444622397
commit
911b686778
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user