From b8602852b77e2b0f9f52b7bcb4fc87040e02ef48 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 13 Dec 2019 21:17:01 +0100 Subject: first step to remove OTR encryption * make OTR available via expert settings and disable it as default --- src/main/java/de/pixart/messenger/ui/SettingsActivity.java | 1 + .../de/pixart/messenger/ui/util/ConversationMenuConfigurator.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/de') diff --git a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java index 2ef7ead13..ae13072c7 100644 --- a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java @@ -75,6 +75,7 @@ public class SettingsActivity extends XmppActivity implements public static final String INDICATE_RECEIVED = "indicate_received"; public static final String USE_INVIDIOUS = "use_invidious"; public static final String ALLOW_MESSAGE_CORRECTION = "allow_message_correction"; + public static final String ENABLE_OTR_ENCRYPTION = "enable_otr_encryption"; public static final int REQUEST_CREATE_BACKUP = 0xbf8701; Preference multiAccountPreference; 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 cb4211b1e..9797da56f 100644 --- a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java +++ b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java @@ -43,6 +43,8 @@ import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.entities.Conversational; import de.pixart.messenger.entities.Message; +import static de.pixart.messenger.ui.SettingsActivity.ENABLE_OTR_ENCRYPTION; + public class ConversationMenuConfigurator { private static boolean microphoneAvailable = false; @@ -128,7 +130,7 @@ public class ConversationMenuConfigurator { menuSecure.setIcon(R.drawable.ic_lock_white_24dp); } - otr.setVisible(Config.supportOtr()); + otr.setVisible(Config.supportOtr() && conversation.getBooleanAttribute(ENABLE_OTR_ENCRYPTION, false)); if (conversation.getMode() == Conversation.MODE_MULTI) { otr.setVisible(false); } -- cgit v1.2.3