From 5e41a659b7256c46667086cf690c428f7c764a4c Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 26 Oct 2019 17:22:25 +0200 Subject: LMC: find replacedMessages based on bare JID --- src/main/java/de/pixart/messenger/entities/Conversation.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/pixart') diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index 707074551..b20976316 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -2,9 +2,10 @@ package de.pixart.messenger.entities; import android.content.ContentValues; import android.database.Cursor; +import android.text.TextUtils; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import android.text.TextUtils; import net.java.otr4j.OtrException; import net.java.otr4j.crypto.OtrCryptoException; @@ -366,8 +367,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()) { -- cgit v1.2.3