always include omemo fallback message

This commit is contained in:
Daniel Gultsch 2018-04-14 21:31:30 +02:00
parent fa13d2336e
commit 91a061f480
1 changed files with 1 additions and 8 deletions

View File

@ -77,9 +77,7 @@ public class MessageGenerator extends AbstractGenerator {
return null;
}
packet.setAxolotlMessage(axolotlMessage.toElement());
if (Config.supportUnencrypted() && !recipientSupportsOmemo(message)) {
packet.setBody(OMEMO_FALLBACK_MESSAGE);
}
packet.setBody(OMEMO_FALLBACK_MESSAGE);
packet.addChild("store", "urn:xmpp:hints");
packet.addChild("encryption","urn:xmpp:eme:0")
.setAttribute("name","OMEMO")
@ -96,11 +94,6 @@ public class MessageGenerator extends AbstractGenerator {
return packet;
}
private static boolean recipientSupportsOmemo(Message message) {
Contact c = message.getContact();
return c != null && c.getPresences().allOrNonSupport(AxolotlService.PEP_DEVICE_LIST_NOTIFY);
}
public static void addMessageHints(MessagePacket packet) {
packet.addChild("private", "urn:xmpp:carbons:2");
packet.addChild("no-copy", "urn:xmpp:hints");