mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Optimize getAccessFor method
This commit is contained in:
parent
7e803dfc46
commit
6dc8435fa1
1 changed files with 5 additions and 4 deletions
|
@ -142,12 +142,13 @@ public class UnidentifiedAccessHelper {
|
|||
|
||||
public Optional<UnidentifiedAccessPair> getAccessFor(RecipientId recipient) {
|
||||
var recipientUnidentifiedAccessKey = getTargetUnidentifiedAccessKey(recipient);
|
||||
if (recipientUnidentifiedAccessKey == null) {
|
||||
return Optional.absent();
|
||||
}
|
||||
|
||||
var selfUnidentifiedAccessKey = getSelfUnidentifiedAccessKey();
|
||||
var selfUnidentifiedAccessCertificate = getSenderCertificateFor(recipient);
|
||||
|
||||
if (recipientUnidentifiedAccessKey == null
|
||||
|| selfUnidentifiedAccessKey == null
|
||||
|| selfUnidentifiedAccessCertificate == null) {
|
||||
if (selfUnidentifiedAccessKey == null || selfUnidentifiedAccessCertificate == null) {
|
||||
return Optional.absent();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue