mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-20 16:14:29 +01:00
fixed bug in send method
* allow sending messages to the sourceUuid see #550
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user