diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-24 21:53:43 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-24 21:53:43 +0200 |
commit | 5527909775a4db91a2187435bbf1b5f3e31417f4 (patch) | |
tree | 162d314e19fc4eb5a1c805c4e92e4a1eda6115b2 /src/main/java/de/pixart/messenger/parser | |
parent | e6b210030da617f264fda02aacb51242db03be56 (diff) |
keep track of user object in messages
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/parser/MessageParser.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java index 6c24345e6..597f84b39 100644 --- a/src/main/java/de/pixart/messenger/parser/MessageParser.java +++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java @@ -539,6 +539,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece } message.markable = packet.hasChild("markable", "urn:xmpp:chat-markers:0"); if (conversationMultiMode) { + message.setMucUser(conversation.getMucOptions().findUserByFullJid(message.getCounterpart())); final Jid fallback = conversation.getMucOptions().getTrueCounterpart(counterpart); Jid trueCounterpart; if (message.getEncryption() == Message.ENCRYPTION_AXOLOTL) { @@ -570,8 +571,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece || replacedMessage.getFingerprint().equals(message.getFingerprint()); final boolean trueCountersMatch = replacedMessage.getTrueCounterpart() != null && replacedMessage.getTrueCounterpart().equals(message.getTrueCounterpart()); + final boolean mucUserMatches = query == null && replacedMessage.sameMucUser(message); //can not be checked when using mam final boolean duplicate = conversation.hasDuplicateMessage(message); - if (fingerprintsMatch && (trueCountersMatch || !conversationMultiMode) && !duplicate) { + if (fingerprintsMatch && (trueCountersMatch || !conversationMultiMode || !mucUserMatches) && !duplicate) { Log.d(Config.LOGTAG, "replaced message '" + replacedMessage.getBody() + "' with '" + message.getBody() + "'"); synchronized (replacedMessage) { final String uuid = replacedMessage.getUuid(); |