From 86b2631449d867b19c4ae27275ab31f60627da87 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 1 May 2020 07:44:57 +0200 Subject: [PATCH] revert commit that attempted to do bare jid matching for LMC That commit never worked because there were other checks in place later down the stream. Allowing other clients (resources) to correct messages introduces the potential for nasty race conditions. Furthermore we also have a check in place that would check that the OMEMO fingerprint is the same for security reasons. Removing that check is currently undesirable. Therefor correcting a message from another client would only work for plain text messages (and maybe PGP); this only adds confusion for users for very little benefit. --- .../java/eu/siacs/conversations/entities/Conversation.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 94efb8fcf..9acd2810d 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -338,10 +338,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl if (mcp == null) { continue; } - final boolean counterpartMatch = mode == MODE_SINGLE ? - counterpart.asBareJid().equals(mcp.asBareJid()) : - counterpart.equals(mcp); - if (counterpartMatch && ((message.getStatus() == Message.STATUS_RECEIVED) == received) + if (mcp.equals(counterpart) && ((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()) {