aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java14
-rw-r--r--src/main/res/values/strings.xml1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 560db367a..a0376e727 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -311,6 +311,17 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
return true;
}
};
+
+ private OnClickListener mOK = new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) {
+ conversation.setNextEncryption(Message.ENCRYPTION_AXOLOTL);
+ activity.refreshUi();
+ }
+ hideSnackbar();
+ }
+ };
private OnClickListener mAllowPresenceSubscription = new OnClickListener() {
@Override
public void onClick(View v) {
@@ -1096,6 +1107,9 @@ 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 (mode == Conversation.MODE_MULTI
&& !conversation.getMucOptions().online()
&& account.getStatus() == Account.State.ONLINE) {
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 25c5df7cf..0d0695cf8 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -741,4 +741,5 @@
<string name="contacts_and_n_more_have_read_up_to_this_point">%1$s +%2$d% more have read up to this point</string>
<string name="pref_return_to_previous">Quick Sharing</string>
<string name="pref_return_to_previous_summary">Immediately return to previous activity instead of opening the conversation after sharing something</string>
+ <string name="conversation_unencrypted_hint">This chat is unencrypted, for security reasons you should activate message encryption by using the lock icon. The preferable encryption is OMEMO.</string>
</resources>