]> nmode's Git Repositories - signal-cli/commitdiff
Fix stripping the correct identifiers when merging recipients
authorAsamK <asamk@gmx.de>
Sun, 8 Sep 2024 07:24:51 +0000 (09:24 +0200)
committerAsamK <asamk@gmx.de>
Sun, 8 Sep 2024 07:24:51 +0000 (09:24 +0200)
lib/src/main/java/org/asamk/signal/manager/storage/recipients/MergeRecipientHelper.java

index 2fa91a5994d28c81033374588449dc9f4fc673b0..edc1121ee2e7b4e55412c76c33ad4ee3eac2a024 100644 (file)
@@ -34,8 +34,7 @@ public class MergeRecipientHelper {
 
             if (recipient.address().aci().isEmpty() || (
                     address.aci().isEmpty() && (
-                            address.pni().isEmpty()
-                                    || recipient.address().pni().equals(address.pni())
+                            address.pni().isEmpty() || recipient.address().pni().equals(address.pni())
                     )
             ) || recipient.address().aci().equals(address.aci())) {
                 logger.debug("Got existing recipient {}, updating with high trust address", recipient.id());
@@ -104,7 +103,7 @@ public class MergeRecipientHelper {
         }
 
         for (final var recipient : recipientsToBeStripped) {
-            store.updateRecipientAddress(recipient.id(), recipient.address().removeIdentifiersFrom(address));
+            store.updateRecipientAddress(recipient.id(), recipient.address().removeIdentifiersFrom(finalAddress));
         }
 
         // Create fixed RecipientIds that won't update its id after merged