Prevent deleting self recipient

This commit is contained in:
AsamK committed 2023-10-09 19:13:45 +02:00
1 parent af3cae5f3d
commit c2ea7045f5
1 file changed
+3
@@ -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()) {