Only send profile key update message from the primary device

This commit is contained in:
AsamK 2022-06-18 12:27:34 +02:00
parent abebffb2cd
commit 280bdbefdc

View file

@ -255,7 +255,10 @@ public final class IncomingMessageHandler {
} else { } else {
// Message wasn't sent as unidentified sender message // Message wasn't sent as unidentified sender message
final var contact = context.getAccount().getContactStore().getContact(sender); final var contact = context.getAccount().getContactStore().getContact(sender);
if (contact != null && !contact.isBlocked() && contact.isProfileSharingEnabled()) { if (account.isPrimaryDevice()
&& contact != null
&& !contact.isBlocked()
&& contact.isProfileSharingEnabled()) {
actions.add(UpdateAccountAttributesAction.create()); actions.add(UpdateAccountAttributesAction.create());
actions.add(new SendProfileKeyAction(sender)); actions.add(new SendProfileKeyAction(sender));
} }