mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-05-21 13:54:18 +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
|
recp := recipient
|
||||||
isGroup := false
|
isGroup := false
|
||||||
if strings.HasPrefix(recipient, groupPrefix) {
|
|
||||||
|
recipientType, err := getRecipientType(recipient)
|
||||||
|
if err != nil {
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if recipientType == ds.Group {
|
||||||
isGroup = true
|
isGroup = true
|
||||||
recp, err = ConvertGroupIdToInternalGroupId(recipient)
|
recp, err = ConvertGroupIdToInternalGroupId(recipient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resp, errors.New("Invalid group id")
|
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 {
|
if s.signalCliMode == JsonRpc {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user