mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Prevent deleting self recipient
This commit is contained in:
parent
af3cae5f3d
commit
c2ea7045f5
1 changed files with 3 additions and 0 deletions
|
@ -424,6 +424,9 @@ public class SignalAccount implements Closeable {
|
|||
|
||||
public void removeRecipient(final RecipientId recipientId) {
|
||||
final var recipientAddress = getRecipientStore().resolveRecipientAddress(recipientId);
|
||||
if (recipientAddress.matches(getSelfRecipientAddress())) {
|
||||
throw new RuntimeException("Can't delete self recipient");
|
||||
}
|
||||
getRecipientStore().deleteRecipientData(recipientId);
|
||||
getMessageCache().deleteMessages(recipientId);
|
||||
if (recipientAddress.serviceId().isPresent()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue