recipientsToBeStripped.add(recipient);
}
- logger.debug("Got separate recipients for high trust identifiers {}, need to merge ({}) and strip ({})",
+ logger.debug("Got separate recipients for high trust identifiers {}, need to merge ({}, {}) and strip ({})",
address,
- recipientsToBeMerged.stream().map(r -> r.id().toString()).collect(Collectors.joining(", ")),
- recipientsToBeStripped.stream().map(r -> r.id().toString()).collect(Collectors.joining(", ")));
+ resultingRecipient.map(RecipientWithAddress::address),
+ recipientsToBeMerged.stream().map(r -> r.address().toString()).collect(Collectors.joining(", ")),
+ recipientsToBeStripped.stream().map(r -> r.address().toString()).collect(Collectors.joining(", ")));
RecipientAddress finalAddress = resultingRecipient.map(RecipientWithAddress::address).orElse(null);
for (final var recipient : recipientsToBeMerged) {
) throws SQLException {
markUnregistered(connection, recipientId);
final var address = resolveRecipientAddress(connection, recipientId);
- if (address.aci().isPresent() && address.pni().isPresent()) {
+ final var needSplit = address.aci().isPresent() && address.pni().isPresent();
+ logger.trace("Marking unregistered recipient {} as unregistered (and split={}): {}",
+ recipientId,
+ needSplit,
+ address);
+ if (needSplit) {
final var numberAddress = new RecipientAddress(address.pni().get(), address.number().orElse(null));
updateRecipientAddress(connection, recipientId, address.removeIdentifiersFrom(numberAddress));
addNewRecipient(connection, numberAddress);