X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/4f2261e86f493a9c8954c02c52ddaa9a46490d20..b738f5740c94fe7a5df9e322e1345a99ef0c5ce5:/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java diff --git a/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java b/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java index d49c23c5..a994c40a 100644 --- a/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java +++ b/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java @@ -1,6 +1,6 @@ package org.asamk.signal.manager.helper; -import org.asamk.signal.storage.profiles.SignalProfile; +import org.asamk.signal.manager.storage.profiles.SignalProfile; import org.signal.libsignal.metadata.certificate.InvalidCertificateException; import org.signal.zkgroup.profiles.ProfileKey; import org.whispersystems.libsignal.util.guava.Optional; @@ -24,7 +24,12 @@ public class UnidentifiedAccessHelper { private final UnidentifiedAccessSenderCertificateProvider senderCertificateProvider; - public UnidentifiedAccessHelper(final SelfProfileKeyProvider selfProfileKeyProvider, final ProfileKeyProvider profileKeyProvider, final ProfileProvider profileProvider, final UnidentifiedAccessSenderCertificateProvider senderCertificateProvider) { + public UnidentifiedAccessHelper( + final SelfProfileKeyProvider selfProfileKeyProvider, + final ProfileKeyProvider profileKeyProvider, + final ProfileProvider profileProvider, + final UnidentifiedAccessSenderCertificateProvider senderCertificateProvider + ) { this.selfProfileKeyProvider = selfProfileKeyProvider; this.profileKeyProvider = profileKeyProvider; this.profileProvider = profileProvider; @@ -62,19 +67,16 @@ public class UnidentifiedAccessHelper { } try { - return Optional.of(new UnidentifiedAccessPair( - new UnidentifiedAccess(selfUnidentifiedAccessKey, selfUnidentifiedAccessCertificate), - new UnidentifiedAccess(selfUnidentifiedAccessKey, selfUnidentifiedAccessCertificate) - )); + return Optional.of(new UnidentifiedAccessPair(new UnidentifiedAccess(selfUnidentifiedAccessKey, + selfUnidentifiedAccessCertificate), + new UnidentifiedAccess(selfUnidentifiedAccessKey, selfUnidentifiedAccessCertificate))); } catch (InvalidCertificateException e) { return Optional.absent(); } } public List> getAccessFor(Collection recipients) { - return recipients.stream() - .map(this::getAccessFor) - .collect(Collectors.toList()); + return recipients.stream().map(this::getAccessFor).collect(Collectors.toList()); } public Optional getAccessFor(SignalServiceAddress recipient) { @@ -82,15 +84,16 @@ public class UnidentifiedAccessHelper { byte[] selfUnidentifiedAccessKey = getSelfUnidentifiedAccessKey(); byte[] selfUnidentifiedAccessCertificate = senderCertificateProvider.getSenderCertificate(); - if (recipientUnidentifiedAccessKey == null || selfUnidentifiedAccessKey == null || selfUnidentifiedAccessCertificate == null) { + if (recipientUnidentifiedAccessKey == null + || selfUnidentifiedAccessKey == null + || selfUnidentifiedAccessCertificate == null) { return Optional.absent(); } try { - return Optional.of(new UnidentifiedAccessPair( - new UnidentifiedAccess(recipientUnidentifiedAccessKey, selfUnidentifiedAccessCertificate), - new UnidentifiedAccess(selfUnidentifiedAccessKey, selfUnidentifiedAccessCertificate) - )); + return Optional.of(new UnidentifiedAccessPair(new UnidentifiedAccess(recipientUnidentifiedAccessKey, + selfUnidentifiedAccessCertificate), + new UnidentifiedAccess(selfUnidentifiedAccessKey, selfUnidentifiedAccessCertificate))); } catch (InvalidCertificateException e) { return Optional.absent(); }