fixed read event when status messages are displayed

This commit is contained in:
Daniel Gultsch 2018-03-31 22:00:46 +02:00
parent 2e934f1517
commit c0d977e97d
1 changed files with 7 additions and 1 deletions

View File

@ -1578,7 +1578,13 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
} }
int pos = binding.messagesView.getLastVisiblePosition(); int pos = binding.messagesView.getLastVisiblePosition();
if (pos >= 0) { 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) { if (message != null) {
while (message.next() != null && message.next().wasMergedIntoPrevious()) { while (message.next() != null && message.next().wasMergedIntoPrevious()) {
message = message.next(); message = message.next();