don't show v\omemo keys as such if not enabled

This commit is contained in:
Daniel Gultsch 2016-03-20 17:24:15 +01:00
parent c4b1f6171d
commit b51ce43d36
2 changed files with 5 additions and 4 deletions

View File

@ -456,7 +456,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
private void onOmemoKeyClicked(Account account, String fingerprint) { private void onOmemoKeyClicked(Account account, String fingerprint) {
final XmppAxolotlSession.Trust trust = account.getAxolotlService().getFingerprintTrust(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); X509Certificate x509Certificate = account.getAxolotlService().getFingerprintCertificate(fingerprint);
if (x509Certificate != null) { if (x509Certificate != null) {
showCertificateInformationDialog(CryptoHelper.extractCertificateInformation(x509Certificate)); showCertificateInformationDialog(CryptoHelper.extractCertificateInformation(x509Certificate));

View File

@ -737,14 +737,15 @@ public abstract class XmppActivity extends Activity {
view.setOnLongClickListener(purge); view.setOnLongClickListener(purge);
key.setOnLongClickListener(purge); key.setOnLongClickListener(purge);
keyType.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) { switch (trust) {
case UNTRUSTED: case UNTRUSTED:
case TRUSTED: case TRUSTED:
case TRUSTED_X509: case TRUSTED_X509:
trustToggle.setChecked(trust.trusted(), false); trustToggle.setChecked(trust.trusted(), false);
trustToggle.setEnabled(trust != XmppAxolotlSession.Trust.TRUSTED_X509); trustToggle.setEnabled(!Config.X509_VERIFICATION || trust != XmppAxolotlSession.Trust.TRUSTED_X509);
if (trust == XmppAxolotlSession.Trust.TRUSTED_X509) { if (Config.X509_VERIFICATION && trust == XmppAxolotlSession.Trust.TRUSTED_X509) {
trustToggle.setOnClickListener(null); trustToggle.setOnClickListener(null);
} }
key.setTextColor(getPrimaryTextColor()); key.setTextColor(getPrimaryTextColor());