diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities/Conversation.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 9 |
1 files changed, 6 insertions, 3 deletions
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()) { |