From 077e695f68e5aa91efe8a568e43aee7e1e416267 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 7 Oct 2019 13:38:56 +0200 Subject: [PATCH] trigger omemo self healing for live msgs on server w/o MAM --- .../java/eu/siacs/conversations/parser/MessageParser.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index c13509f04..b9bedec1a 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -112,7 +112,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece return false; } - private Message parseAxolotlChat(Element axolotlMessage, Jid from, Conversation conversation, int status, boolean checkedForDuplicates, boolean postpone) { + private Message parseAxolotlChat(Element axolotlMessage, Jid from, Conversation conversation, int status, final boolean checkedForDuplicates, boolean postpone) { final AxolotlService service = conversation.getAccount().getAxolotlService(); final XmppAxolotlMessage xmppAxolotlMessage; try { @@ -136,7 +136,6 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece } } else { Log.d(Config.LOGTAG,"ignoring broken session exception because checkForDuplicates failed"); - //TODO should be still emit a failed message? return null; } } catch (NotEncryptedForThisDeviceException e) { @@ -497,8 +496,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece origin = from; } - //TODO either or is probably fine? - final boolean checkedForDuplicates = serverMsgId != null && remoteMsgId != null && !conversation.possibleDuplicate(serverMsgId, remoteMsgId); + final boolean liveMessage = query == null && !isTypeGroupChat && mucUserElement == null; + final boolean checkedForDuplicates = liveMessage || (serverMsgId != null && remoteMsgId != null && !conversation.possibleDuplicate(serverMsgId, remoteMsgId)); if (origin != null) { message = parseAxolotlChat(axolotlEncrypted, origin, conversation, status, checkedForDuplicates,query != null);