aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/generator
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-07-14 16:06:05 +0200
committerChristian Schneppe <christian@pix-art.de>2016-07-17 15:22:18 +0200
commit78a60fb85a6b5101f6cee8b4efa156746ac279a3 (patch)
treeb435796e74c9160b6a5d5d195e745dedba1396ef /src/main/java/eu/siacs/conversations/generator
parent7565568c6a8964306bee680b8a3d1c6f0a6fe347 (diff)
include pgp and omemo fallback message only when unencrypted is enabled
Diffstat (limited to 'src/main/java/eu/siacs/conversations/generator')
-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 cb06219f6..5ef47a335 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) {