diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-13 22:57:59 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-13 22:57:59 +0200 |
commit | c1c490de23e0ba6500379102475bcebe53614186 (patch) | |
tree | 09ba7c017a814495409a5c3b27d34bf9dfcc1dd8 /src/main/java/de | |
parent | df85e23d7d66426ac295be2b0be3fefccea37b48 (diff) |
hide disable encryption button when omemo is in always mode
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java index c1938aef9..6f5135d9e 100644 --- a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java +++ b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java @@ -25,6 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import de.pixart.messenger.Config; import de.pixart.messenger.R; +import de.pixart.messenger.crypto.OmemoSetting; import de.pixart.messenger.crypto.axolotl.AxolotlService; import de.pixart.messenger.crypto.axolotl.FingerprintStatus; import de.pixart.messenger.databinding.ActivityTrustKeysBinding; @@ -237,7 +238,12 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat Contact contact = mAccount.getRoster().getContact(contactJids.get(0)); binding.keyErrorGeneral.setText(getString(R.string.error_trustkey_general, contact.getDisplayName())); binding.ownKeysDetails.removeAllViews(); - binding.disableButton.setOnClickListener(this::disableEncryptionDialog); + if (OmemoSetting.isAlways()) { + binding.disableButton.setVisibility(View.GONE); + } else { + binding.disableButton.setVisibility(View.VISIBLE); + binding.disableButton.setOnClickListener(this::disableEncryptionDialog); + } binding.ownKeysCard.setVisibility(View.GONE); binding.foreignKeys.removeAllViews(); binding.foreignKeys.setVisibility(View.GONE); @@ -283,6 +289,9 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat private boolean reloadFingerprints() { List<Jid> acceptedTargets = mConversation == null ? new ArrayList<>() : mConversation.getAcceptedCryptoTargets(); ownKeysToTrust.clear(); + if (this.mAccount == null) { + return false; + } AxolotlService service = this.mAccount.getAxolotlService(); Set<IdentityKey> ownKeysSet = service.getKeysWithTrust(FingerprintStatus.createActiveUndecided()); for (final IdentityKey identityKey : ownKeysSet) { |