aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/parser/MessageParser.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2019-10-26 19:02:55 +0200
committerChristian Schneppe <christian.schneppe@pix-art.de>2019-10-26 19:02:55 +0200
commit5ac2a42d13bf062eb00fee0b1bded8e9074dc5e1 (patch)
treee0ab736b0e8f1782bbe82a7fb7789d370d144c67 /src/main/java/de/pixart/messenger/parser/MessageParser.java
parent7d8514492af52d1e7590317478dd3e85af202606 (diff)
trigger omemo self healing for live msgs on server w/o MAM
Diffstat (limited to 'src/main/java/de/pixart/messenger/parser/MessageParser.java')
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index 7557096bc..ab65c101d 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -205,7 +205,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
}
- 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 {
@@ -229,7 +229,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) {
@@ -606,8 +605,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
fallbacksBySourceId = Collections.emptySet();
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);