From c0d977e97dcb4b61b78a0a949afedb0744d0d5a0 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 31 Mar 2018 22:00:46 +0200 Subject: [PATCH] fixed read event when status messages are displayed --- .../eu/siacs/conversations/ui/ConversationFragment.java | 8 +++++++- 1 file changed, 7 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 8af307667..624445028 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1578,7 +1578,13 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } int pos = binding.messagesView.getLastVisiblePosition(); if (pos >= 0) { - Message message = (Message) binding.messagesView.getItemAtPosition(pos); + Message message = null; + for(int i = pos ; i >= 0; --i) { + message = (Message) binding.messagesView.getItemAtPosition(i); + if (message.getType() != Message.TYPE_STATUS) { + break; + } + } if (message != null) { while (message.next() != null && message.next().wasMergedIntoPrevious()) { message = message.next();