diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index f11bbc00..19da7c2d 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -954,6 +954,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 @@ -1047,6 +1054,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 826d02e0..cbf9a365 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -738,4 +738,5 @@ Contact blocked. Notifications from strangers Notify for messages received from strangers. + Received message from stranger