- updateRecipientAddressLocked(byNumber.get().getRecipientId(),
- new RecipientAddress(byNumber.get().getAddress().uuid().get()));
- updateRecipientAddressLocked(byUuid.get().getRecipientId(), address);
- return new Pair<>(byUuid.get().getRecipientId(), Optional.empty());
+ if (byNumberRecipient.getAddress().uuid().isPresent()) {
+ logger.debug(
+ "Got separate recipients for high trust number {} and uuid {}, recipient for number has different uuid, so stripping its number",
+ byNumberRecipient.getRecipientId(),
+ byUuidRecipient.getRecipientId());
+
+ updateRecipientAddressLocked(byNumberRecipient.getRecipientId(),
+ new RecipientAddress(byNumberRecipient.getAddress().uuid().get()));
+ updateRecipientAddressLocked(byUuidRecipient.getRecipientId(), address);
+ return new Pair<>(byUuidRecipient.getRecipientId(), Optional.empty());