diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-11-25 20:39:23 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-11-25 20:40:28 +0100 |
commit | da360fa89c81bdd64deb102027c98a22ae2b47ae (patch) | |
tree | 8bf9a016817b59de7a9b00e6a6e63551dd2ea83b /src/main/java/de/pixart/messenger/ui/ConversationFragment.java | |
parent | 5efdeb9de7bb38115b6082ba803c16c25f8472f4 (diff) |
make unencrypted chat warning configurable via settings
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index a0376e727..a8f8cf1dc 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -312,10 +312,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa } }; - private OnClickListener mOK = new OnClickListener() { + private OnClickListener mHideUnencryptionHint = new OnClickListener() { @Override public void onClick(View v) { - if (conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) { + if (Config.supportOmemo() && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) { conversation.setNextEncryption(Message.ENCRYPTION_AXOLOTL); activity.refreshUi(); } @@ -1107,9 +1107,14 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa showSnackbar(R.string.contact_added_you, R.string.add_back, this.mAddBackClickListener, this.mLongPressBlockListener); } else if (contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { showSnackbar(R.string.contact_asks_for_presence_subscription, R.string.allow, this.mAllowPresenceSubscription, this.mLongPressBlockListener); - } else if (conversation.getNextEncryption() == Message.ENCRYPTION_NONE - && (mode == Conversation.MODE_SINGLE || (mode == Conversation.MODE_MULTI && conversation.getMucOptions().membersOnly() && conversation.getMucOptions().nonanonymous()))) { - showSnackbar(R.string.conversation_unencrypted_hint, R.string.ok, mOK , null); + } else if (activity.xmppConnectionService.warnUnecryptedChat() && (conversation.getNextEncryption() == Message.ENCRYPTION_NONE + && ((mode == Conversation.MODE_SINGLE) + && ((Config.supportOmemo() && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) + || (Config.supportOpenPgp() && account.isPgpDecryptionServiceConnected()) || Config.supportOtr())) + || ((mode == Conversation.MODE_MULTI && conversation.getMucOptions().membersOnly() && conversation.getMucOptions().nonanonymous()) + && (Config.supportOmemo() && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation) + || (Config.supportOpenPgp() && account.isPgpDecryptionServiceConnected()))))) { + showSnackbar(R.string.conversation_unencrypted_hint, R.string.ok, mHideUnencryptionHint, null); } else if (mode == Conversation.MODE_MULTI && !conversation.getMucOptions().online() && account.getStatus() == Account.State.ONLINE) { |