import org.asamk.signal.manager.api.Message;
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
import org.asamk.signal.manager.api.Pair;
+import org.asamk.signal.manager.api.ReceiveConfig;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.api.SendGroupMessageResults;
import org.asamk.signal.manager.api.SendMessageResult;
context.getAccountHelper().setDeviceName(deviceName);
}
context.getAccountHelper().updateAccountAttributes();
+ context.getAccountHelper().checkWhoAmiI();
}
@Override
@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) {
}
@Override
- public void setIgnoreAttachments(final boolean ignoreAttachments) {
- context.getReceiveHelper().setIgnoreAttachments(ignoreAttachments);
+ public void setReceiveConfig(final ReceiveConfig receiveConfig) {
+ context.getReceiveHelper().setReceiveConfig(receiveConfig);
}
@Override
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;
}