Prevent deleting self recipient

This commit is contained in:
AsamK 2023-10-09 19:08:32 +02:00
parent af3cae5f3d
commit c2ea7045f5

View file

@ -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()) {