From fd4cd4c746efa48cbc4396e87b95fa075fadb1f0 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 9 Mar 2017 20:33:52 +0100 Subject: show snackbar in conversations with stranger to block --- src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java/de/pixart') 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(); } -- cgit v1.2.3