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
1 changed files with 4 additions and 1 deletions

View File

@ -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();