aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-07-14 16:06:05 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-07-14 16:06:05 +0200
commit2803d342e1f008217aa6f003d917423b6e6e106b (patch)
tree112d8777ef4a1af3ed7e97b44e859b5be0494b11 /src/main/java/eu
parent223d50c1a01e89fd76dfab77e15e6eee00796236 (diff)
include pgp and omemo fallback message only when unencrypted is enabled
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/generator/MessageGenerator.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java b/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java
index cb06219f..5ef47a33 100644
--- a/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java
+++ b/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java
@@ -9,6 +9,7 @@ import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
+import eu.siacs.conversations.Config;
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
import eu.siacs.conversations.crypto.axolotl.XmppAxolotlMessage;
import eu.siacs.conversations.entities.Account;
@@ -74,7 +75,7 @@ public class MessageGenerator extends AbstractGenerator {
return null;
}
packet.setAxolotlMessage(axolotlMessage.toElement());
- if (!recipientSupportsOmemo(message)) {
+ if (Config.supportUnencrypted() && !recipientSupportsOmemo(message)) {
packet.setBody(OMEMO_FALLBACK_MESSAGE);
}
packet.addChild("store", "urn:xmpp:hints");
@@ -130,7 +131,9 @@ public class MessageGenerator extends AbstractGenerator {
public MessagePacket generatePgpChat(Message message) {
MessagePacket packet = preparePacket(message);
- packet.setBody(PGP_FALLBACK_MESSAGE);
+ if (Config.supportUnencrypted()) {
+ packet.setBody(PGP_FALLBACK_MESSAGE);
+ }
if (message.getEncryption() == Message.ENCRYPTION_DECRYPTED) {
packet.addChild("x", "jabber:x:encrypted").setContent(message.getEncryptedBody());
} else if (message.getEncryption() == Message.ENCRYPTION_PGP) {