From a3b51f76541ad05a8d6705c109909b3c4de9775e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 8 Mar 2017 11:54:52 +0100 Subject: [PATCH] do not show 'block stranger' snackbar in empty conversations --- .../java/eu/siacs/conversations/ui/ConversationFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 19da7c2d7..43fad234f 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1054,7 +1054,9 @@ 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()) { + } else if (conversation.countMessages() != 0 + && !conversation.isBlocked() + && conversation.isWithStranger()) { showSnackbar(R.string.received_message_from_stranger,R.string.block, mBlockClickListener); } else { hideSnackbar();