import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Function;
import java.util.stream.Collectors;
}
});
disposable.add(account.getIdentityKeyStore().getIdentityChanges().subscribe(recipientId -> {
- logger.trace("Archiving old sessions");
+ logger.trace("Archiving old sessions for {}", recipientId);
account.getSessionStore().archiveSessions(recipientId);
account.getSenderKeyStore().deleteSharedWith(recipientId);
final var profile = account.getRecipientStore().getProfile(recipientId);
}
@Override
- public void removeLinkedDevices(long deviceId) throws IOException {
+ public void removeLinkedDevices(int deviceId) throws IOException {
context.getAccountHelper().removeLinkedDevices(deviceId);
}
) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException {
var delete = new SignalServiceDataMessage.RemoteDelete(targetSentTimestamp);
final var messageBuilder = SignalServiceDataMessage.newBuilder().withRemoteDelete(delete);
+ for (final var recipient : recipients) {
+ if (recipient instanceof RecipientIdentifier.Single r) {
+ try {
+ final var recipientId = context.getRecipientHelper().resolveRecipient(r);
+ account.getMessageSendLogStore().deleteEntryForRecipientNonGroup(targetSentTimestamp, recipientId);
+ } catch (UnregisteredRecipientException ignored) {
+ }
+ } else if (recipient instanceof RecipientIdentifier.Group r) {
+ account.getMessageSendLogStore().deleteEntryForGroup(targetSentTimestamp, r.groupId());
+ }
+ }
return sendMessage(messageBuilder, recipients);
}
}
}
+ private static final AtomicInteger threadNumber = new AtomicInteger(0);
+
private void startReceiveThreadIfRequired() {
if (receiveThread != null) {
return;
}
}
});
+ receiveThread.setName("receive-" + threadNumber.getAndIncrement());
receiveThread.start();
}