aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-03-09 20:33:52 +0100
committerChristian Schneppe <christian@pix-art.de>2017-03-09 20:33:52 +0100
commitfd4cd4c746efa48cbc4396e87b95fa075fadb1f0 (patch)
tree0aaca7ba4794f173185a90c4c59c0e72816a293c
parent2764f04c14bdc19ee1d267e43bafbffb29257c64 (diff)
show snackbar in conversations with stranger to block
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java9
-rw-r--r--src/main/res/values/strings.xml1
2 files changed, 10 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 b985a2c35..18c3cb5cf 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -988,6 +988,13 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
};
+ private OnClickListener mBlockClickListener = new OnClickListener() {
+ @Override
+ public void onClick(final View v) {
+ BlockContactDialog.show(activity, conversation);
+ }
+ };
+
private OnClickListener mAddBackClickListener = new OnClickListener() {
@Override
@@ -1082,6 +1089,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
&& (conversation.getOtrSession().getSessionStatus() == SessionStatus.ENCRYPTED)
&& (!conversation.isOtrFingerprintVerified())) {
showSnackbar(R.string.unknown_otr_fingerprint, R.string.verify, clickToVerify);
+ } else if (conversation.isWithStranger() && !conversation.isBlocked()) {
+ showSnackbar(R.string.received_message_from_stranger, R.string.block, mBlockClickListener);
} else {
hideSnackbar();
}
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index b569381c3..c16c7b921 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -751,4 +751,5 @@
<string name="contact_blocked_past_tense">Contact blocked.</string>
<string name="pref_notifications_from_strangers">Notifications from strangers</string>
<string name="pref_notifications_from_strangers_summary">Notify for messages received from strangers.</string>
+ <string name="received_message_from_stranger">Received message from stranger</string>
</resources>