save changed server id in replaced messages

This commit is contained in:
Daniel Gultsch 2017-12-11 15:55:55 +01:00
parent 946d97074f
commit 37bd26c75f

View file

@ -531,7 +531,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
} }
if (replacementId != null && mXmppConnectionService.allowMessageCorrection()) { if (replacementId != null && mXmppConnectionService.allowMessageCorrection()) {
Message replacedMessage = conversation.findMessageWithRemoteIdAndCounterpart(replacementId, final Message replacedMessage = conversation.findMessageWithRemoteIdAndCounterpart(replacementId,
counterpart, counterpart,
message.getStatus() == Message.STATUS_RECEIVED, message.getStatus() == Message.STATUS_RECEIVED,
message.isCarbon()); message.isCarbon());
@ -549,6 +549,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
replacedMessage.setBody(message.getBody()); replacedMessage.setBody(message.getBody());
replacedMessage.setEdited(replacedMessage.getRemoteMsgId()); replacedMessage.setEdited(replacedMessage.getRemoteMsgId());
replacedMessage.setRemoteMsgId(remoteMsgId); replacedMessage.setRemoteMsgId(remoteMsgId);
if (replacedMessage.getServerMsgId() == null || message.getServerMsgId() != null) {
replacedMessage.setServerMsgId(message.getServerMsgId());
}
replacedMessage.setEncryption(message.getEncryption()); replacedMessage.setEncryption(message.getEncryption());
if (replacedMessage.getStatus() == Message.STATUS_RECEIVED) { if (replacedMessage.getStatus() == Message.STATUS_RECEIVED) {
replacedMessage.markUnread(); replacedMessage.markUnread();