# HG changeset patch # User Michel Le Bihan # Date 1476370420 -7200 # Node ID 611a787e6d080d28f1c6937cd5d867f736ef7351 # Parent f933e3909795b3cb1603d2db5f9a5694d6104959 mod_e2e_policy: Do not reply to error stenzas diff -r f933e3909795 -r 611a787e6d08 mod_e2e_policy/mod_e2e_policy.lua --- a/mod_e2e_policy/mod_e2e_policy.lua Thu Oct 13 12:26:45 2016 +0200 +++ b/mod_e2e_policy/mod_e2e_policy.lua Thu Oct 13 16:53:40 2016 +0200 @@ -10,12 +10,13 @@ local e2e_policy_message_required_muc = module:get_option_string("e2e_policy_message_required_muc", "For security reasons, OMEMO, OTR or PGP encryption is required for MUC on this server."); function warn_on_plaintext_messages(event) - if e2e_policy_whitelist:contains(event.stanza.attr.from) or e2e_policy_whitelist:contains(event.stanza.attr.to) then -- check if JID is whitelisted + -- check if JID is whitelisted + if e2e_policy_whitelist:contains(event.stanza.attr.from) or e2e_policy_whitelist:contains(event.stanza.attr.to) then return nil; end local body = event.stanza:get_child_text("body"); -- do not warn for status messages - if not body then + if not body or event.stanza.attr.type == "error" then return nil; end -- check otr @@ -30,7 +31,7 @@ if event.stanza:get_child("x", "jabber:x:encrypted") then return nil; end - -- check xep373 pgp (OX) https://xmpp.org/extensions/xep-0373.html + -- check xep373 pgp (OX) https://xmpp.org/extensions/xep-0373.html if event.stanza:get_child("openpgp", "urn:xmpp:openpgp:0") then return nil; end