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 --- plugins/omemo/src/trust_manager.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/omemo/src') diff --git a/plugins/omemo/src/trust_manager.vala b/plugins/omemo/src/trust_manager.vala index 75c0d809..cd0971f8 100644 --- a/plugins/omemo/src/trust_manager.vala +++ b/plugins/omemo/src/trust_manager.vala @@ -247,7 +247,9 @@ public class TrustManager { StanzaNode? _encrypted = stanza.stanza.get_subnode("encrypted", NS_URI); if (_encrypted == null || MessageFlag.get_flag(stanza) != null || stanza.from == null) return false; StanzaNode encrypted = (!)_encrypted; - if (message.body == null) message.body = "[This message is OMEMO encrypted]"; + if (message.body == null && Xep.ExplicitEncryption.get_encryption_tag(stanza) == NS_URI) { + message.body = "[This message is OMEMO encrypted]"; // TODO temporary + }; if (!Plugin.ensure_context()) return false; MessageFlag flag = new MessageFlag(); stanza.add_flag(flag); -- cgit v1.2.3-70-g09d2