diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-02-08 12:16:45 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-02-08 12:16:45 +0100 |
commit | aa4117c935ed98c856242332d23d19a007fcb48b (patch) | |
tree | f1600496c326c55f877003acd26393edb9669abc /src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java | |
parent | 59836f5d429145f460b07dbf0e5095780606f2a6 (diff) |
hide lock icon in channels; modify muc user context
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java index dd69b2337..45a1989e7 100644 --- a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java +++ b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java @@ -101,11 +101,17 @@ public class ConversationMenuConfigurator { final MenuItem pgp = menu.findItem(R.id.encryption_choice_pgp); final MenuItem axolotl = menu.findItem(R.id.encryption_choice_axolotl); + final int next = conversation.getNextEncryption(); + boolean visible; if (OmemoSetting.isAlways()) { visible = false; } else if (conversation.getMode() == Conversation.MODE_MULTI) { - visible = (Config.supportOpenPgp() || Config.supportOmemo()) && Config.multipleEncryptionChoices(); + if (next == Message.ENCRYPTION_NONE && !conversation.isPrivateAndNonAnonymous() && !conversation.getBooleanAttribute(Conversation.ATTRIBUTE_FORMERLY_PRIVATE_NON_ANONYMOUS, false)) { + visible = false; + } else { + visible = (Config.supportOpenPgp() || Config.supportOmemo()) && Config.multipleEncryptionChoices(); + } } else { visible = Config.multipleEncryptionChoices(); } @@ -127,10 +133,6 @@ public class ConversationMenuConfigurator { pgp.setVisible(Config.supportOpenPgp()); none.setVisible(Config.supportUnencrypted() || conversation.getMode() == Conversation.MODE_MULTI); axolotl.setVisible(Config.supportOmemo()); - final AxolotlService axolotlService = conversation.getAccount().getAxolotlService(); - if (axolotlService == null || !axolotlService.isConversationAxolotlCapable(conversation)) { - axolotl.setEnabled(false); - } switch (conversation.getNextEncryption()) { case Message.ENCRYPTION_NONE: none.setChecked(true); |