]> nmode's Git Repositories - signal-cli/commitdiff
Only send profile key update message from the primary device
authorAsamK <asamk@gmx.de>
Sat, 18 Jun 2022 10:27:34 +0000 (12:27 +0200)
committerAsamK <asamk@gmx.de>
Sat, 18 Jun 2022 10:28:02 +0000 (12:28 +0200)
lib/src/main/java/org/asamk/signal/manager/helper/IncomingMessageHandler.java

index 4940e67cbd9db926285742ff732e52a933ef16c4..d18cc0c0aff4c3f9ca882d473d3c0d1705358187 100644 (file)
@@ -255,7 +255,10 @@ public final class IncomingMessageHandler {
             } else {
                 // Message wasn't sent as unidentified sender message
                 final var contact = context.getAccount().getContactStore().getContact(sender);
             } else {
                 // Message wasn't sent as unidentified sender message
                 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(new SendProfileKeyAction(sender));
                 }
                     actions.add(UpdateAccountAttributesAction.create());
                     actions.add(new SendProfileKeyAction(sender));
                 }