Mercurial > prosody-modules
diff mod_firewall/mod_firewall.lua @ 5793:e304e19536f2
mod_firewall: TO/FROM ROLE: Handle JIDs with no role (thanks Zash)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 12 Dec 2023 19:06:37 +0000 |
parents | ad5c77793750 |
children | 866a49f5aa61 |
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua Mon Dec 11 19:09:25 2023 +0000 +++ b/mod_firewall/mod_firewall.lua Tue Dec 12 19:06:37 2023 +0000 @@ -261,6 +261,14 @@ return code, { "search:"..search_name, "pattern:"..pattern_name }; end; }; + sender_role = { + local_code = [[local sender_role = get_jid_role(bare_from, current_host)]]; + depends = { "bare_from", "current_host", "get_jid_role" }; + }; + recipient_role = { + local_code = [[local recipient_role = get_jid_role(bare_to, current_host)]]; + depends = { "bare_to", "current_host", "get_jid_role" }; + }; scan_list = { global_code = [[local function scan_list(list, items) for item in pairs(items) do if list:contains(item) then return true; end end end]]; };