Load recipient profiles in listContacts command if required

This commit is contained in:
AsamK 2026-02-25 20:08:23 +01:00
parent 10fa3e1619
commit 2ea26b9d1b

View File

@ -1479,7 +1479,21 @@ public class ManagerImpl implements Manager {
return List.of();
}
// refresh profiles of explicitly given recipients
context.getProfileHelper().refreshRecipientProfiles(recipientIds);
if (recipientIds.isEmpty()) {
final var rIds = account.getRecipientStore()
.getRecipients(onlyContacts, blocked, recipientIds, name)
.stream()
.filter(r -> r.isRegistered())
.map(r -> r.getRecipientId())
.toList();
try {
context.getProfileHelper().getRecipientProfiles(rIds);
} catch (Exception e) {
logger.warn("Failed to refresh profiles for recipients", e);
}
} else {
context.getProfileHelper().refreshRecipientProfiles(recipientIds);
}
return account.getRecipientStore()
.getRecipients(onlyContacts, blocked, recipientIds, name)
.stream()