From 37bd26c75fe7c1681343eb11880419fc0828f03d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 11 Dec 2017 15:55:55 +0100 Subject: [PATCH] save changed server id in replaced messages --- .../java/eu/siacs/conversations/parser/MessageParser.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 77e435e9a..b16ecbd47 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -531,7 +531,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece } if (replacementId != null && mXmppConnectionService.allowMessageCorrection()) { - Message replacedMessage = conversation.findMessageWithRemoteIdAndCounterpart(replacementId, + final Message replacedMessage = conversation.findMessageWithRemoteIdAndCounterpart(replacementId, counterpart, message.getStatus() == Message.STATUS_RECEIVED, message.isCarbon()); @@ -549,6 +549,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece replacedMessage.setBody(message.getBody()); replacedMessage.setEdited(replacedMessage.getRemoteMsgId()); replacedMessage.setRemoteMsgId(remoteMsgId); + if (replacedMessage.getServerMsgId() == null || message.getServerMsgId() != null) { + replacedMessage.setServerMsgId(message.getServerMsgId()); + } replacedMessage.setEncryption(message.getEncryption()); if (replacedMessage.getStatus() == Message.STATUS_RECEIVED) { replacedMessage.markUnread();