# HG changeset patch # User Michel Le Bihan # Date 1533734452 -7200 # Node ID 58d61459cdb1f0817efc496f8549282945976b53 # Parent 67f1d1f2262565c7903c320c201e33bd8ec62e86 mod_e2e_policy: Always add the 'to' in warning stanzas diff -r 67f1d1f22625 -r 58d61459cdb1 mod_e2e_policy/mod_e2e_policy.lua --- 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));