changeset 3219:58d61459cdb1

mod_e2e_policy: Always add the 'to' in warning stanzas
author Michel Le Bihan <michel@lebihan.pl>
date Wed, 08 Aug 2018 15:20:52 +0200
parents 67f1d1f22625
children 0e78523f8c20
files mod_e2e_policy/mod_e2e_policy.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_e2e_policy/mod_e2e_policy.lua	Wed Aug 08 12:49:02 2018 +0100
+++ b/mod_e2e_policy/mod_e2e_policy.lua	Wed Aug 08 15:20:52 2018 +0200
@@ -37,13 +37,13 @@
     end
     -- no valid encryption found
     if e2e_policy_chat == "optional" and event.stanza.attr.type ~= "groupchat" then
-        event.origin.send(st.message({ from = host, type = "headline" }, e2e_policy_message_optional_chat));
+        event.origin.send(st.message({ from = host, to = event.stanza.attr.from, type = "headline" }, e2e_policy_message_optional_chat));
     end
     if e2e_policy_chat == "required" and event.stanza.attr.type ~= "groupchat" then
         return event.origin.send(st.error_reply(event.stanza, "modify", "policy-violation", e2e_policy_message_required_chat));
     end
     if e2e_policy_muc == "optional" and event.stanza.attr.type == "groupchat" then
-        event.origin.send(st.message({ from = host, type = "headline" }, e2e_policy_message_optional_muc));
+        event.origin.send(st.message({ from = host, to = event.stanza.attr.from, type = "headline" }, e2e_policy_message_optional_muc));
     end
     if e2e_policy_muc == "required" and event.stanza.attr.type == "groupchat" then
         return event.origin.send(st.error_reply(event.stanza, "modify", "policy-violation", e2e_policy_message_required_muc));