diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-09-26 21:19:18 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-09-26 21:19:18 +0200 |
commit | 96250f0b823bc320b9da6063cf9b77545b153b45 (patch) | |
tree | a232cd24837102682a37af85791508735d0df7bc /src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java | |
parent | dd7bcdfbef276a0b18bf3d4cfee8b8a51b80a947 (diff) |
show inactive keys if all of them are
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java index 4e1e414fa..3aabf08e4 100644 --- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java @@ -30,6 +30,7 @@ import android.widget.Toast; import org.openintents.openpgp.util.OpenPgpUtils; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; @@ -562,12 +563,20 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp } final AxolotlService axolotlService = contact.getAccount().getAxolotlService(); if (Config.supportOmemo() && axolotlService != null) { + final Collection<XmppAxolotlSession> sessions = axolotlService.findSessionsForContact(contact); + boolean anyActive = false; + for(XmppAxolotlSession session : sessions) { + anyActive = session.getTrust().isActive(); + if (anyActive) { + break; + } + } boolean skippedInactive = false; boolean showsInactive = false; - for (final XmppAxolotlSession session : axolotlService.findSessionsForContact(contact)) { + for (final XmppAxolotlSession session : sessions) { final FingerprintStatus trust = session.getTrust(); hasKeys |= !trust.isCompromised(); - if (!trust.isActive()) { + if (!trust.isActive() && anyActive) { if (showInactiveOmemo) { showsInactive = true; } else { |