Show pgp inline menu item only if encryption/signing is actually enabled
@@ -273,10 +273,6 @@ public class RecipientPresenter implements PermissionPingCallback {
ComposeCryptoStatus currentCryptoStatus = getCurrentCachedCryptoStatus();
boolean isCryptoConfigured = currentCryptoStatus != null && currentCryptoStatus.isProviderStateOk();
if (isCryptoConfigured) {
- boolean pgpInlineModeEnabled = currentCryptoStatus.isPgpInlineModeEnabled();
- menu.findItem(R.id.openpgp_inline_enable).setVisible(!pgpInlineModeEnabled);
- menu.findItem(R.id.openpgp_inline_disable).setVisible(pgpInlineModeEnabled);
-
boolean isEncrypting = currentCryptoStatus.isEncryptionEnabled();
menu.findItem(R.id.openpgp_encrypt_enable).setVisible(!isEncrypting);
menu.findItem(R.id.openpgp_encrypt_disable).setVisible(isEncrypting);
@@ -285,6 +281,11 @@ public class RecipientPresenter implements PermissionPingCallback {
boolean isSignOnly = currentCryptoStatus.isSignOnly();
menu.findItem(R.id.openpgp_sign_only).setVisible(showSignOnly && !isSignOnly);
menu.findItem(R.id.openpgp_sign_only_disable).setVisible(showSignOnly && isSignOnly);
+
+ boolean pgpInlineModeEnabled = currentCryptoStatus.isPgpInlineModeEnabled();
+ boolean showPgpInlineEnable = (isEncrypting || isSignOnly) && !pgpInlineModeEnabled;
+ menu.findItem(R.id.openpgp_inline_enable).setVisible(showPgpInlineEnable);
+ menu.findItem(R.id.openpgp_inline_disable).setVisible(pgpInlineModeEnabled);
} else {
menu.findItem(R.id.openpgp_inline_enable).setVisible(false);
menu.findItem(R.id.openpgp_inline_disable).setVisible(false);
