context.getAccountHelper().setDeviceName(deviceName);
}
context.getAccountHelper().updateAccountAttributes();
+ context.getAccountHelper().checkWhoAmiI();
}
@Override
final var quote = message.quote().get();
messageBuilder.withQuote(new SignalServiceDataMessage.Quote(quote.timestamp(),
context.getRecipientHelper()
- .resolveSignalServiceAddress(context.getRecipientHelper().resolveRecipient(quote.author())),
+ .resolveSignalServiceAddress(context.getRecipientHelper().resolveRecipient(quote.author()))
+ .getServiceId(),
quote.message(),
List.of(),
resolveMentions(quote.mentions()),
var targetAuthorRecipientId = context.getRecipientHelper().resolveRecipient(targetAuthor);
var reaction = new SignalServiceDataMessage.Reaction(emoji,
remove,
- context.getRecipientHelper().resolveSignalServiceAddress(targetAuthorRecipientId),
+ context.getRecipientHelper().resolveSignalServiceAddress(targetAuthorRecipientId).getServiceId(),
targetSentTimestamp);
final var messageBuilder = SignalServiceDataMessage.newBuilder().withReaction(reaction);
return sendMessage(messageBuilder, recipients);
@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;
}