aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/parser/MessageParser.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/parser/MessageParser.java')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index 3714ac904..9944f364f 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -320,7 +320,14 @@ public class MessageParser extends AbstractParser implements
Message finishedMessage = new Message(conversation,content,encryption,status);
finishedMessage.setTime(timestamp);
finishedMessage.setCounterpart(counterpart);
- Log.d(Config.LOGTAG,"received mam message "+content);
+ finishedMessage.setRemoteMsgId(message.getAttribute("id"));
+ finishedMessage.setServerMsgId(result.getAttribute("id"));
+ if (conversation.hasDuplicateMessage(finishedMessage)) {
+ Log.d(Config.LOGTAG, "received mam message " + content+ " (duplicate)");
+ return null;
+ } else {
+ Log.d(Config.LOGTAG, "received mam message " + content);
+ }
return finishedMessage;
}