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) { synchronized (this.messages) {
for (int i = this.messages.size() - 1; i >= 0; --i) { for (int i = this.messages.size() - 1; i >= 0; --i) {
final Message message = messages.get(i); final Message message = messages.get(i);
if (counterpart.equals(message.getCounterpart()) final boolean counterpartMatch = mode == MODE_SINGLE ?
&& ((message.getStatus() == Message.STATUS_RECEIVED) == received) counterpart.asBareJid().equals(message.getCounterpart().asBareJid()) :
counterpart.equals(message.getCounterpart());
if (counterpartMatch && ((message.getStatus() == Message.STATUS_RECEIVED) == received)
&& (carbon == message.isCarbon() || received)) { && (carbon == message.isCarbon() || received)) {
final boolean idMatch = id.equals(message.getRemoteMsgId()) || message.remoteMsgIdMatchInEdit(id); final boolean idMatch = id.equals(message.getRemoteMsgId()) || message.remoteMsgIdMatchInEdit(id);
if (idMatch && !message.isFileOrImage() && !message.treatAsDownloadable()) { if (idMatch && !message.isFileOrImage() && !message.treatAsDownloadable()) {