diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-05-15 11:51:20 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-05-20 03:48:14 +0200 |
commit | eeebebe32afef42cb3be07641d0c008a67f766ab (patch) | |
tree | 3535759a16416e601eb113e80c82ba6ed9836aad /src/main/java/eu | |
parent | b731995a517932d1c86877da13dd69d66cbb23c1 (diff) |
fixed read/unread markers
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/MessageParser.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 69f58898..339aeb7f 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -181,7 +181,6 @@ public class MessageParser extends AbstractParser implements final MessagePacket packet; Long timestamp = null; final boolean isForwarded; - boolean carbon = false; //live carbons or mam-sub MessageArchiveService.Query query = null; String serverMsgId = null; if (original.fromServer(account)) { @@ -192,15 +191,14 @@ public class MessageParser extends AbstractParser implements packet = f != null ? f.first : original; timestamp = f != null ? f.second : null; isForwarded = f != null; - carbon = original.hasChild("received", "urn:xmpp:carbons:2") || original.hasChild("received", "urn:xmpp:carbons:2"); - Element fin = packet.findChild("fin", "urn:xmpp:mam:0"); + Element fin = original.findChild("fin", "urn:xmpp:mam:0"); if (fin != null) { mXmppConnectionService.getMessageArchiveService().processFin(fin); return; } - final Element result = packet.findChild("result","urn:xmpp:mam:0"); + final Element result = original.findChild("result","urn:xmpp:mam:0"); if (result != null) { query = mXmppConnectionService.getMessageArchiveService().findQuery(result.getAttribute("queryid")); if (query != null) { @@ -307,14 +305,15 @@ public class MessageParser extends AbstractParser implements query.incrementMessageCount(); } conversation.add(message); - if (carbon || status == Message.STATUS_RECEIVED) { - mXmppConnectionService.markRead(conversation); - account.activateGracePeriod(); - } else if (!isForwarded) { - message.markUnread(); + if (serverMsgId == null) { + if (status == Message.STATUS_SEND) { + mXmppConnectionService.markRead(conversation); + account.activateGracePeriod(); + } else { + message.markUnread(); + } } - if (mXmppConnectionService.confirmMessages() && remoteMsgId != null && !isForwarded) { if (packet.hasChild("markable", "urn:xmpp:chat-markers:0")) { MessagePacket receipt = mXmppConnectionService |