LMC: find replacedMessages based on bare JID (#3548)

This commit is contained in:
ChaosKid42 2019-10-05 22:18:42 +02:00 committed by Daniel Gultsch
parent 6155938623
commit af898b3bc4

View file

@ -307,8 +307,10 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
synchronized (this.messages) {
for (int i = this.messages.size() - 1; i >= 0; --i) {
final Message message = messages.get(i);
if (counterpart.equals(message.getCounterpart())
&& ((message.getStatus() == Message.STATUS_RECEIVED) == received)
final boolean counterpartMatch = mode == MODE_SINGLE ?
counterpart.asBareJid().equals(message.getCounterpart().asBareJid()) :
counterpart.equals(message.getCounterpart());
if (counterpartMatch && ((message.getStatus() == Message.STATUS_RECEIVED) == received)
&& (carbon == message.isCarbon() || received)) {
final boolean idMatch = id.equals(message.getRemoteMsgId()) || message.remoteMsgIdMatchInEdit(id);
if (idMatch && !message.isFileOrImage() && !message.treatAsDownloadable()) {