+
+ private RecipientId getDestination(SignalServiceEnvelope envelope) {
+ if (!envelope.hasDestinationUuid()) {
+ return account.getSelfRecipientId();
+ }
+ final var addressOptional = SignalServiceAddress.fromRaw(envelope.getDestinationUuid(), null);
+ if (addressOptional.isEmpty()) {
+ return account.getSelfRecipientId();
+ }
+ return context.getRecipientHelper().resolveRecipient(addressOptional.get());
+ }