From: AsamK Date: Fri, 3 Dec 2021 13:25:07 +0000 (+0100) Subject: Fix to always update recipientsMerged map when merging recipients X-Git-Tag: v0.10.0~33 X-Git-Url: https://git.nmode.ca/signal-cli/commitdiff_plain/855d06dc76885677004c7443b425da648f50c03c?ds=sidebyside Fix to always update recipientsMerged map when merging recipients --- 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 16a9f4cb..10f67c2a 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 @@ -309,9 +309,6 @@ public class RecipientStore implements RecipientResolver, ContactsStore, Profile final Pair> pair; synchronized (recipients) { pair = resolveRecipientLocked(address, isHighTrust); - if (pair.second().isPresent()) { - recipientsMerged.put(pair.second().get(), pair.first()); - } } if (pair.second().isPresent()) { @@ -378,6 +375,7 @@ public class RecipientStore implements RecipientResolver, ContactsStore, Profile logger.debug("Got separate recipients for high trust number and uuid, need to merge them"); updateRecipientAddressLocked(byUuid.get().getRecipientId(), address); mergeRecipientsLocked(byUuid.get().getRecipientId(), byNumber.get().getRecipientId()); + recipientsMerged.put(byNumber.get().getRecipientId(), byUuid.get().getRecipientId()); return new Pair<>(byUuid.get().getRecipientId(), byNumber.map(Recipient::getRecipientId)); }