diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java index 54f4af76..a323c6d9 100644 --- a/lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java +++ b/lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java @@ -226,7 +226,15 @@ public class RecipientStore implements ContactsStore, ProfileStore { public void storeProfileKey(final RecipientId recipientId, final ProfileKey profileKey) { synchronized (recipients) { final var recipient = recipients.get(recipientId); - storeRecipientLocked(recipientId, Recipient.newBuilder(recipient).withProfileKey(profileKey).build()); + if (profileKey.equals(recipient.getProfileKey())) { + return; + } + + final var newRecipient = Recipient.newBuilder(recipient) + .withProfileKey(profileKey) + .withProfileKeyCredential(null) + .build(); + storeRecipientLocked(recipientId, newRecipient); } }