From 78ec625dbe0912fc166d62b0507942f462569f4f Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 20 Feb 2019 01:44:33 +0100 Subject: Check for eme tag before adding fallback text for empty-body OMEMO messages --- xmpp-vala/src/module/xep/0380_explicit_encryption.vala | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xmpp-vala/src/module') diff --git a/xmpp-vala/src/module/xep/0380_explicit_encryption.vala b/xmpp-vala/src/module/xep/0380_explicit_encryption.vala index 710da92d..e956bc43 100644 --- a/xmpp-vala/src/module/xep/0380_explicit_encryption.vala +++ b/xmpp-vala/src/module/xep/0380_explicit_encryption.vala @@ -10,5 +10,13 @@ public static void add_encryption_tag_to_message(MessageStanza message, string n message.stanza.put_node(encryption); } + +public static string? get_encryption_tag(MessageStanza message) { + StanzaNode? encryption_node = message.stanza.get_subnode("encryption", NS_URI); + if (encryption_node != null) { + return encryption_node.get_attribute("namespace", NS_URI); + } + return null; +} } -- cgit v1.2.3-70-g09d2