deduplicate every message with a stanza-id from the server

This commit is contained in:
Daniel Gultsch 2017-03-06 11:24:04 +01:00
parent 6088913fb6
commit 4a7dbaab1e

View file

@ -532,9 +532,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
return; return;
} }
boolean checkForDuplicates = query != null boolean checkForDuplicates = (isTypeGroupChat && packet.hasChild("delay","urn:xmpp:delay"))
|| (isTypeGroupChat && packet.hasChild("delay","urn:xmpp:delay")) || message.getType() == Message.TYPE_PRIVATE
|| message.getType() == Message.TYPE_PRIVATE; || message.getServerMsgId() != null;
if (checkForDuplicates && conversation.hasDuplicateMessage(message)) { if (checkForDuplicates && conversation.hasDuplicateMessage(message)) {
Log.d(Config.LOGTAG,"skipping duplicate message from "+message.getCounterpart().toString()+" "+message.getBody()); Log.d(Config.LOGTAG,"skipping duplicate message from "+message.getCounterpart().toString()+" "+message.getBody());
return; return;