aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/parser
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-08-03 23:56:13 +0200
committerChristian Schneppe <christian@pix-art.de>2018-08-03 23:56:13 +0200
commit16f2aad5973163e7d473153af282f5fa5783ec36 (patch)
treed22af5dc232a51db5911813050178ec972df3ab6 /src/main/java/de/pixart/messenger/parser
parent2ba8db31de2f3c2af0334c035b8275aee2ff2920 (diff)
also mark previews unread messages as read
Diffstat (limited to 'src/main/java/de/pixart/messenger/parser')
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index e86758fd7..7cfd69e8b 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -844,7 +844,17 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
if (message.addReadByMarker(readByMarker)) {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": added read by (" + readByMarker.getRealJid() + ") to message '" + message.getBody() + "'");
mXmppConnectionService.updateMessage(message, false);
- mXmppConnectionService.markMessage(account, from.asBareJid(), id, Message.STATUS_SEND_DISPLAYED);
+ final Message displayedMessage = mXmppConnectionService.markMessage(account, from.asBareJid(), id, Message.STATUS_SEND_DISPLAYED);
+ Message m = displayedMessage == null ? null : displayedMessage.prev();
+ while (m != null
+ && m.getStatus() == Message.STATUS_SEND_RECEIVED
+ && m.getTimeSent() < displayedMessage.getTimeSent()) {
+ mXmppConnectionService.markMessage(m, Message.STATUS_SEND_DISPLAYED);
+ m = m.prev();
+ }
+ if (displayedMessage != null && selfAddressed) {
+ dismissNotification(account, counterpart, query);
+ }
}
}
}