mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-25 10:04:23 +01:00
Prevent deleting self recipient
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user