From b51ce43d36aad7633ac504b952be65a05116e20e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 20 Mar 2016 17:24:15 +0100 Subject: [PATCH] don't show v\omemo keys as such if not enabled --- .../eu/siacs/conversations/ui/ContactDetailsActivity.java | 2 +- src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java index 4165b4be5..e4fc59fab 100644 --- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -456,7 +456,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd private void onOmemoKeyClicked(Account account, String fingerprint) { final XmppAxolotlSession.Trust trust = account.getAxolotlService().getFingerprintTrust(fingerprint); - if (trust != null && trust == XmppAxolotlSession.Trust.TRUSTED_X509) { + if (Config.X509_VERIFICATION && trust != null && trust == XmppAxolotlSession.Trust.TRUSTED_X509) { X509Certificate x509Certificate = account.getAxolotlService().getFingerprintCertificate(fingerprint); if (x509Certificate != null) { showCertificateInformationDialog(CryptoHelper.extractCertificateInformation(x509Certificate)); diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index c7bf738c7..fe3a30313 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -737,14 +737,15 @@ public abstract class XmppActivity extends Activity { view.setOnLongClickListener(purge); key.setOnLongClickListener(purge); keyType.setOnLongClickListener(purge); - boolean x509 = trust == XmppAxolotlSession.Trust.TRUSTED_X509 || trust == XmppAxolotlSession.Trust.INACTIVE_TRUSTED_X509; + boolean x509 = Config.X509_VERIFICATION + && (trust == XmppAxolotlSession.Trust.TRUSTED_X509 || trust == XmppAxolotlSession.Trust.INACTIVE_TRUSTED_X509); switch (trust) { case UNTRUSTED: case TRUSTED: case TRUSTED_X509: trustToggle.setChecked(trust.trusted(), false); - trustToggle.setEnabled(trust != XmppAxolotlSession.Trust.TRUSTED_X509); - if (trust == XmppAxolotlSession.Trust.TRUSTED_X509) { + trustToggle.setEnabled(!Config.X509_VERIFICATION || trust != XmppAxolotlSession.Trust.TRUSTED_X509); + if (Config.X509_VERIFICATION && trust == XmppAxolotlSession.Trust.TRUSTED_X509) { trustToggle.setOnClickListener(null); } key.setTextColor(getPrimaryTextColor());