aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/omemo/src/stream_module.vala1
-rw-r--r--plugins/openpgp/src/stream_module.vala1
-rw-r--r--xmpp-vala/CMakeLists.txt1
-rw-r--r--xmpp-vala/src/module/xep/0380_explicit_encryption.vala14
4 files changed, 17 insertions, 0 deletions
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;
diff --git a/xmpp-vala/CMakeLists.txt b/xmpp-vala/CMakeLists.txt
index 3190fad0..6734f0ee 100644
--- a/xmpp-vala/CMakeLists.txt
+++ b/xmpp-vala/CMakeLists.txt
@@ -68,6 +68,7 @@ SOURCES
"src/module/xep/0313_message_archive_management.vala"
"src/module/xep/0333_chat_markers.vala"
"src/module/xep/0368_srv_records_tls.vala"
+ "src/module/xep/0380_explicit_encryption.vala"
"src/module/xep/pixbuf_storage.vala"
PACKAGES
${ENGINE_PACKAGES}
diff --git a/xmpp-vala/src/module/xep/0380_explicit_encryption.vala b/xmpp-vala/src/module/xep/0380_explicit_encryption.vala
new file mode 100644
index 00000000..710da92d
--- /dev/null
+++ b/xmpp-vala/src/module/xep/0380_explicit_encryption.vala
@@ -0,0 +1,14 @@
+namespace Xmpp.Xep.ExplicitEncryption {
+public const string NS_URI = "urn:xmpp:eme:0";
+
+public static void add_encryption_tag_to_message(MessageStanza message, string ns, string? name = null) {
+ StanzaNode encryption = new StanzaNode.build("encryption", NS_URI).add_self_xmlns()
+ .put_attribute("namespace", ns);
+
+ if(name != null)
+ encryption.put_attribute("name", name);
+
+ message.stanza.put_node(encryption);
+}
+
+}