deduplicate private muc messages

This commit is contained in:
Daniel Gultsch 2015-05-26 12:00:55 +02:00
parent 6059ed4738
commit 402e5363d1

View file

@ -307,7 +307,9 @@ public class MessageParser extends AbstractParser implements
} }
} }
updateLastseen(packet,account,true); updateLastseen(packet,account,true);
boolean checkForDuplicates = serverMsgId != null || (isTypeGroupChat && packet.hasChild("delay","urn:xmpp:delay")); boolean checkForDuplicates = serverMsgId != null
|| (isTypeGroupChat && packet.hasChild("delay","urn:xmpp:delay"))
|| message.getType() == Message.TYPE_PRIVATE;
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;