From 62e5e6485e75df355226e3d48ee23ea11aff223f Mon Sep 17 00:00:00 2001 From: Samuel Hand Date: Mon, 28 May 2018 15:19:51 +0100 Subject: Implement XEP-0380 for the OMEMO and OpenPGP plugins (#359) * Implement XEP-0380 in a naive fashion for both the OMEMO and OpenPGP plugins * Move the XEP-0380 namespace to a constant * Move the implementation for xep-0380 to its own module * Remove un-needed lines from plugins/openpgp/src/stream_module.vala --- plugins/omemo/src/stream_module.vala | 1 + plugins/openpgp/src/stream_module.vala | 1 + 2 files changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/omemo/src/stream_module.vala b/plugins/omemo/src/stream_module.vala index 4494e834..0148a7f2 100644 --- a/plugins/omemo/src/stream_module.vala +++ b/plugins/omemo/src/stream_module.vala @@ -94,6 +94,7 @@ public class StreamModule : XmppStreamModule { } message.stanza.put_node(encrypted); + Xep.ExplicitEncryption.add_encryption_tag_to_message(message, NS_URI, "OMEMO"); message.body = "[This message is OMEMO encrypted]"; status.encrypted = true; } catch (Error e) { diff --git a/plugins/openpgp/src/stream_module.vala b/plugins/openpgp/src/stream_module.vala index 3bcc3326..f7c24b80 100644 --- a/plugins/openpgp/src/stream_module.vala +++ b/plugins/openpgp/src/stream_module.vala @@ -37,6 +37,7 @@ namespace Dino.Plugins.OpenPgp { if (enc_body != null) { message.stanza.put_node(new StanzaNode.build("x", NS_URI_ENCRYPTED).add_self_xmlns().put_node(new StanzaNode.text(enc_body))); message.body = "[This message is OpenPGP encrypted (see XEP-0027)]"; + Xep.ExplicitEncryption.add_encryption_tag_to_message(message, NS_URI_ENCRYPTED); return true; } return false; -- cgit v1.2.3-70-g09d2