From 4a7dbaab1e0196708b0d2d8ea1c0fd4a3f54edcd Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 6 Mar 2017 11:24:04 +0100 Subject: [PATCH] deduplicate every message with a stanza-id from the server --- .../java/eu/siacs/conversations/parser/MessageParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index d5bf99a04..b52091cdf 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -532,9 +532,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece return; } - boolean checkForDuplicates = query != null - || (isTypeGroupChat && packet.hasChild("delay","urn:xmpp:delay")) - || message.getType() == Message.TYPE_PRIVATE; + boolean checkForDuplicates = (isTypeGroupChat && packet.hasChild("delay","urn:xmpp:delay")) + || message.getType() == Message.TYPE_PRIVATE + || message.getServerMsgId() != null; if (checkForDuplicates && conversation.hasDuplicateMessage(message)) { Log.d(Config.LOGTAG,"skipping duplicate message from "+message.getCounterpart().toString()+" "+message.getBody()); return;