aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-11-29 22:24:36 +0100
committerChristian Schneppe <christian@pix-art.de>2017-11-29 22:24:36 +0100
commite863a114498799e474d7d62000eb5d470bb4980b (patch)
tree635e477173bd2ba4aeeb5a3716266e9e99877d39
parenta077d57c743e1571dd045befb721b72fc3b72f92 (diff)
add exception list for encryption warning
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java16
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/Patches.java3
2 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 65f1eef9b..bfb5dfe2d 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -87,6 +87,8 @@ import de.pixart.messenger.xmpp.XmppConnection;
import de.pixart.messenger.xmpp.chatstate.ChatState;
import de.pixart.messenger.xmpp.jid.Jid;
+import static de.pixart.messenger.xmpp.Patches.ENCRYPTION_EXCEPTIONS;
+
public class ConversationFragment extends Fragment implements EditMessage.KeyboardListener {
final protected List<Message> messageList = new ArrayList<>();
@@ -1171,12 +1173,22 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
((Config.supportOmemo() && axolotlService != null && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) ||
(Config.supportOpenPgp() && account.isPgpDecryptionServiceConnected()) ||
Config.supportOtr()))) {
- showSnackbar(R.string.conversation_unencrypted_hint, R.string.ok, mHideUnencryptionHint, null);
+ if (ENCRYPTION_EXCEPTIONS.contains(conversation.getJid().toString()) || conversation.getJid().toString().equals(account.getJid().getDomainpart())) {
+ Log.d(Config.LOGTAG, "Don't show unenctrypted warning because " + conversation.getJid().toString() + " is on exception list");
+ hideSnackbar();
+ } else {
+ showSnackbar(R.string.conversation_unencrypted_hint, R.string.ok, mHideUnencryptionHint, null);
+ }
} else if ((mode == Conversation.MODE_MULTI && conversation.getMucOptions().membersOnly() && conversation.getMucOptions().nonanonymous()) &&
(conversation.getNextEncryption() == Message.ENCRYPTION_NONE &&
((Config.supportOmemo() && axolotlService != null && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) ||
(Config.supportOpenPgp() && account.isPgpDecryptionServiceConnected())))) {
- showSnackbar(R.string.conversation_unencrypted_hint, R.string.ok, mHideUnencryptionHint, null);
+ if (ENCRYPTION_EXCEPTIONS.contains(conversation.getJid().toString()) || conversation.getJid().toString().equals(account.getJid().getDomainpart())) {
+ Log.d(Config.LOGTAG, "Don't show unenctrypted warning because " + conversation.getJid().toString() + " is on exception list");
+ hideSnackbar();
+ } else {
+ showSnackbar(R.string.conversation_unencrypted_hint, R.string.ok, mHideUnencryptionHint, null);
+ }
} else {
hideSnackbar();
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/Patches.java b/src/main/java/de/pixart/messenger/xmpp/Patches.java
index 52eb114f2..83ca2b9fa 100644
--- a/src/main/java/de/pixart/messenger/xmpp/Patches.java
+++ b/src/main/java/de/pixart/messenger/xmpp/Patches.java
@@ -10,4 +10,7 @@ public class Patches {
public static final List<XmppConnection.Identity> BAD_MUC_REFLECTION = Arrays.asList(
XmppConnection.Identity.SLACK
);
+ public static final List<String> ENCRYPTION_EXCEPTIONS = Arrays.asList(
+ "bugs@pix-art.de"
+ );
} \ No newline at end of file