mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Extend merge/split logging
This commit is contained in:
parent
ce813e4529
commit
1e685c7cab
2 changed files with 10 additions and 4 deletions
|
@ -83,10 +83,11 @@ public class MergeRecipientHelper {
|
||||||
recipientsToBeStripped.add(recipient);
|
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,
|
address,
|
||||||
recipientsToBeMerged.stream().map(r -> r.id().toString()).collect(Collectors.joining(", ")),
|
resultingRecipient.map(RecipientWithAddress::address),
|
||||||
recipientsToBeStripped.stream().map(r -> r.id().toString()).collect(Collectors.joining(", ")));
|
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);
|
RecipientAddress finalAddress = resultingRecipient.map(RecipientWithAddress::address).orElse(null);
|
||||||
for (final var recipient : recipientsToBeMerged) {
|
for (final var recipient : recipientsToBeMerged) {
|
||||||
|
|
|
@ -994,7 +994,12 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||||
) throws SQLException {
|
) throws SQLException {
|
||||||
markUnregistered(connection, recipientId);
|
markUnregistered(connection, recipientId);
|
||||||
final var address = resolveRecipientAddress(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));
|
final var numberAddress = new RecipientAddress(address.pni().get(), address.number().orElse(null));
|
||||||
updateRecipientAddress(connection, recipientId, address.removeIdentifiersFrom(numberAddress));
|
updateRecipientAddress(connection, recipientId, address.removeIdentifiersFrom(numberAddress));
|
||||||
addNewRecipient(connection, numberAddress);
|
addNewRecipient(connection, numberAddress);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue