+ public Pair<List<HandleAction>, Exception> handleRetryEnvelope(
+ final SignalServiceEnvelope envelope,
+ final boolean ignoreAttachments,
+ final Manager.ReceiveMessageHandler handler
+ ) {
+ SignalServiceContent content = null;
+ if (!envelope.isReceipt()) {
+ try {
+ content = dependencies.getCipher().decrypt(envelope);
+ } catch (ProtocolUntrustedIdentityException e) {
+ final var recipientId = account.getRecipientStore().resolveRecipient(e.getSender());
+ final var exception = new UntrustedIdentityException(addressResolver.resolveSignalServiceAddress(
+ recipientId), e.getSenderDevice());
+ return new Pair<>(List.of(), exception);
+ } catch (Exception e) {
+ return new Pair<>(List.of(), e);
+ }
+ }
+ final var actions = checkAndHandleMessage(envelope, content, ignoreAttachments, handler, null);
+ return new Pair<>(actions, null);
+ }
+