aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-08-25 19:20:53 +0200
committeriNPUTmice <daniel@gultsch.de>2014-08-25 19:20:53 +0200
commit450b911cb2eb2fc8ee6006782e921934a9b08144 (patch)
tree6dd83d99691e252e388ce46de0b97642f0accd1e /src/eu
parent07b422d4c8fa02cf72ae21c324ca41b58835749c (diff)
fixing duplicate private muc messages
Diffstat (limited to 'src/eu')
-rw-r--r--src/eu/siacs/conversations/parser/MessageParser.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java
index 06c0923a..ad1ce9b9 100644
--- a/src/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/eu/siacs/conversations/parser/MessageParser.java
@@ -40,15 +40,18 @@ public class MessageParser extends AbstractParser implements
packet.getBody(), Message.ENCRYPTION_NONE,
Message.STATUS_RECIEVED);
}
+ finishedMessage.setRemoteMsgId(packet.getId());
if (conversation.getMode() == Conversation.MODE_MULTI
&& fromParts.length >= 2) {
finishedMessage.setType(Message.TYPE_PRIVATE);
finishedMessage.setPresence(fromParts[1]);
finishedMessage.setTrueCounterpart(conversation.getMucOptions()
.getTrueCounterpart(fromParts[1]));
+ if (conversation.hasDuplicateMessage(finishedMessage)) {
+ return null;
+ }
}
- finishedMessage.setRemoteMsgId(packet.getId());
finishedMessage.setTime(getTimestamp(packet));
return finishedMessage;
}
@@ -236,7 +239,9 @@ public class MessageParser extends AbstractParser implements
finishedMessage.setPresence(parts[1]);
finishedMessage.setTrueCounterpart(conversation.getMucOptions()
.getTrueCounterpart(parts[1]));
-
+ if (conversation.hasDuplicateMessage(finishedMessage)) {
+ return null;
+ }
}
return finishedMessage;
@@ -362,7 +367,9 @@ public class MessageParser extends AbstractParser implements
}
} else if (packet.hasChild("body")) {
message = this.parseChat(packet, account);
- message.markUnread();
+ if (message != null) {
+ message.markUnread();
+ }
} else if (packet.hasChild("received") || (packet.hasChild("sent"))) {
message = this.parseCarbonMessage(packet, account);
if (message != null) {