From bf0b3fe351b530b64768afe03fdeaa7a130dbcde Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 22 Apr 2018 19:26:08 +0200 Subject: fixed read event when status messages are displayed --- src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger/ui') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 3e4962cdb..1feb40b1f 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -1855,7 +1855,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(); -- cgit v1.2.3