Comparison

mod_admin_blocklist/mod_admin_blocklist.lua @ 5016:964de9997552

mod_admin_blocklist: Fix traceback due to misplaced parenthesis get_jids_with_role() throws an exception when 'host' is nil since Prosody trunk rev 7ca5645f46cd
author Kim Alvefur <zash@zash.se>
date Sat, 27 Aug 2022 15:39:38 +0200
parent 4805:683d1ad16b56
child 5017:96e83b4a93f7
comparison
equal deleted inserted replaced
5015:47d9f704d14b 5016:964de9997552
15 local usermanager = require "core.usermanager"; 15 local usermanager = require "core.usermanager";
16 16
17 local admins; 17 local admins;
18 if usermanager.get_jids_with_role then 18 if usermanager.get_jids_with_role then
19 local set = require "util.set"; 19 local set = require "util.set";
20 admins = set.new(usermanager.get_jids_with_role("prosody:admin"), module.host); 20 admins = set.new(usermanager.get_jids_with_role("prosody:admin", module.host));
21 else -- COMPAT w/pre-0.12 21 else -- COMPAT w/pre-0.12
22 admins = module:get_option_inherited_set("admins", {}); 22 admins = module:get_option_inherited_set("admins", {});
23 end 23 end
24 admins = admins / 24 admins = admins /
25 function (admin) -- Filter out non-local admins 25 function (admin) -- Filter out non-local admins