From a1f933924c47ecf12d2ee3f3e32f07e218d61468 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 7 Jul 2018 08:53:11 +0200 Subject: [PATCH] open trust key screen when download is in progress --- .../eu/siacs/conversations/crypto/axolotl/AxolotlService.java | 2 +- .../java/eu/siacs/conversations/ui/ConversationFragment.java | 3 ++- src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index 3d23c65d1..99353ed30 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -1256,7 +1256,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { return verified; } - public boolean hasPendingKeyFetches(Account account, List jids) { + public boolean hasPendingKeyFetches(List jids) { SignalProtocolAddress ownAddress = new SignalProtocolAddress(account.getJid().asBareJid().toString(), 0); if (fetchStatusMap.getAll(ownAddress.getName()).containsValue(FetchStatus.PENDING)) { return true; diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index fd593054b..35509d9b9 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -745,7 +745,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke boolean hasUndecidedContacts = !axolotlService.getKeysWithTrust(FingerprintStatus.createActiveUndecided(), targets).isEmpty(); boolean hasPendingKeys = !axolotlService.findDevicesWithoutSession(conversation).isEmpty(); boolean hasNoTrustedKeys = axolotlService.anyTargetHasNoTrustedKeys(targets); - if (hasUndecidedOwn || hasUndecidedContacts || hasPendingKeys || hasNoTrustedKeys || hasUnaccepted) { + boolean downloadInProgress = axolotlService.hasPendingKeyFetches(targets); + if (hasUndecidedOwn || hasUndecidedContacts || hasPendingKeys || hasNoTrustedKeys || hasUnaccepted || downloadInProgress) { axolotlService.createSessionsIfNeeded(conversation); Intent intent = new Intent(getActivity(), TrustKeysActivity.class); String[] contacts = new String[targets.size()]; diff --git a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java index 22896f6be..0fbeef6eb 100644 --- a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java @@ -353,7 +353,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat } private boolean hasPendingKeyFetches() { - return mAccount != null && mAccount.getAxolotlService().hasPendingKeyFetches(mAccount, contactJids); + return mAccount != null && mAccount.getAxolotlService().hasPendingKeyFetches(contactJids); }