@Override
public void setContactName(
- RecipientIdentifier.Single recipient, String name
+ RecipientIdentifier.Single recipient, String givenName, final String familyName
) throws NotPrimaryDeviceException, UnregisteredRecipientException {
if (!account.isPrimaryDevice()) {
throw new NotPrimaryDeviceException();
}
- context.getContactHelper().setContactName(context.getRecipientHelper().resolveRecipient(recipient), name);
+ context.getContactHelper()
+ .setContactName(context.getRecipientHelper().resolveRecipient(recipient), givenName, familyName);
}
@Override
}
void retrieveRemoteStorage() throws IOException {
- if (account.getStorageKey() != null) {
- context.getStorageHelper().readDataFromStorage();
- }
+ context.getStorageHelper().readDataFromStorage();
}
@Override
logger.debug("Starting receiving messages");
context.getReceiveHelper().receiveMessagesContinuously((envelope, e) -> {
synchronized (messageHandlers) {
- Stream.concat(messageHandlers.stream(), weakHandlers.stream()).forEach(h -> {
+ final var handlers = Stream.concat(messageHandlers.stream(), weakHandlers.stream()).toList();
+ handlers.forEach(h -> {
try {
h.handleMessage(envelope, e);
} catch (Throwable ex) {
return null;
}
}).filter(Objects::nonNull).collect(Collectors.toSet());
+ if (!recipients.isEmpty() && recipientIds.isEmpty()) {
+ return List.of();
+ }
// refresh profiles of explicitly given recipients
context.getProfileHelper().refreshRecipientProfiles(recipientIds);
return account.getRecipientStore().getRecipients(onlyContacts, blocked, recipientIds, name);
IdentityInfo identity;
try {
identity = account.getIdentityKeyStore()
- .getIdentity(context.getRecipientHelper().resolveRecipient(recipient));
+ .getIdentityInfo(context.getRecipientHelper().resolveRecipient(recipient));
} catch (UnregisteredRecipientException e) {
identity = null;
}