mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-01-26 19:03:33 +00:00
fix: use getRecipientType instead of HasPrefix in RemoteDelete
This commit is contained in:
parent
af3eadbbc0
commit
de2cb043fc
@ -2543,12 +2543,20 @@ func (s *SignalClient) RemoteDelete(number string, recipient string, timestamp i
|
||||
|
||||
recp := recipient
|
||||
isGroup := false
|
||||
if strings.HasPrefix(recipient, groupPrefix) {
|
||||
|
||||
recipientType, err := getRecipientType(recipient)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
||||
if recipientType == ds.Group {
|
||||
isGroup = true
|
||||
recp, err = ConvertGroupIdToInternalGroupId(recipient)
|
||||
if err != nil {
|
||||
return resp, errors.New("Invalid group id")
|
||||
}
|
||||
} else if recipientType != ds.Number && recipientType != ds.Username {
|
||||
return resp, errors.New("Invalid recipient type")
|
||||
}
|
||||
|
||||
if s.signalCliMode == JsonRpc {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user