aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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