Mercurial > prosody-modules
comparison 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 |
comparison
equal
deleted
inserted
replaced
5792:14e17927c0ec | 5793:e304e19536f2 |
---|---|
259 end | 259 end |
260 ]]):format(search_name, pattern_name, search_name, search_name, pattern_name, search_name, pattern_name); | 260 ]]):format(search_name, pattern_name, search_name, search_name, pattern_name, search_name, pattern_name); |
261 return code, { "search:"..search_name, "pattern:"..pattern_name }; | 261 return code, { "search:"..search_name, "pattern:"..pattern_name }; |
262 end; | 262 end; |
263 }; | 263 }; |
264 sender_role = { | |
265 local_code = [[local sender_role = get_jid_role(bare_from, current_host)]]; | |
266 depends = { "bare_from", "current_host", "get_jid_role" }; | |
267 }; | |
268 recipient_role = { | |
269 local_code = [[local recipient_role = get_jid_role(bare_to, current_host)]]; | |
270 depends = { "bare_to", "current_host", "get_jid_role" }; | |
271 }; | |
264 scan_list = { | 272 scan_list = { |
265 global_code = [[local function scan_list(list, items) for item in pairs(items) do if list:contains(item) then return true; end end end]]; | 273 global_code = [[local function scan_list(list, items) for item in pairs(items) do if list:contains(item) then return true; end end end]]; |
266 }; | 274 }; |
267 iplib = { | 275 iplib = { |
268 global_code = [[local iplib = require "util.ip";]]; | 276 global_code = [[local iplib = require "util.ip";]]; |