diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-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 { |