diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-01-29 20:10:53 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-01-29 20:10:53 +0100 |
commit | 8340212dc47f2c941fbb28bc4b14002f08797088 (patch) | |
tree | 04c9922449d9651340d197a2f0960922c60df900 /src/main | |
parent | ceba706df4847e160cafc8da5a9e2aba38a857ac (diff) |
add explicit encryption hints to outgoing messages
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/crypto/OtrService.java | 1 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/generator/MessageGenerator.java | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/OtrService.java b/src/main/java/de/pixart/messenger/crypto/OtrService.java index 459f49c38..df4cd9acd 100644 --- a/src/main/java/de/pixart/messenger/crypto/OtrService.java +++ b/src/main/java/de/pixart/messenger/crypto/OtrService.java @@ -196,6 +196,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost { } packet.setType(MessagePacket.TYPE_CHAT); + packet.addChild("encryption", "urn:xmpp:eme:0").setAttribute("namespace", "urn:xmpp:otr:0"); account.getXmppConnection().sendMessagePacket(packet); } diff --git a/src/main/java/de/pixart/messenger/generator/MessageGenerator.java b/src/main/java/de/pixart/messenger/generator/MessageGenerator.java index bdb4b7837..b66fb4dc5 100644 --- a/src/main/java/de/pixart/messenger/generator/MessageGenerator.java +++ b/src/main/java/de/pixart/messenger/generator/MessageGenerator.java @@ -79,6 +79,7 @@ public class MessageGenerator extends AbstractGenerator { packet.setBody(OMEMO_FALLBACK_MESSAGE); } packet.addChild("store", "urn:xmpp:hints"); + packet.addChild("encryption", "urn:xmpp:eme:0").setAttribute("name", "OMEMO").setAttribute("namespace", AxolotlService.PEP_PREFIX); return packet; } @@ -109,6 +110,7 @@ public class MessageGenerator extends AbstractGenerator { content = message.getBody(); } packet.setBody(otrSession.transformSending(content)[0]); + packet.addChild("encryption", "urn:xmpp:eme:0").setAttribute("namespace", "urn:xmpp:otr:0"); return packet; } catch (OtrException e) { return null; @@ -139,6 +141,7 @@ public class MessageGenerator extends AbstractGenerator { } else if (message.getEncryption() == Message.ENCRYPTION_PGP) { packet.addChild("x", "jabber:x:encrypted").setContent(message.getBody()); } + packet.addChild("encryption", "urn:xmpp:eme:0").setAttribute("namespace", "jabber:x:encrypted"); return packet; } |