revert commit that attempted to do bare jid matching for LMC

Daniel Gultsch created

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.

Change summary

src/main/java/eu/siacs/conversations/entities/Conversation.java | 5 --
1 file changed, 1 insertion(+), 4 deletions(-)

Detailed changes

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()) {