comparison mod_firewall/mod_firewall.lua @ 1324:853a382c9bd6

mod_turncredentials: Advertise the XEP-0215 feature (thanks Gryffus)
author Kim Alvefur <zash@zash.se>
date Fri, 28 Feb 2014 15:36:06 +0100
parents 9f24ccaa66a6
children b21236b6b8d8
comparison
equal deleted inserted replaced
1323:c84ff82658cb 1324:853a382c9bd6
23 "presence/bare", "presence/full", "presence/host"; 23 "presence/bare", "presence/full", "presence/host";
24 "iq/bare", "iq/full", "iq/host"; 24 "iq/bare", "iq/full", "iq/host";
25 }; 25 };
26 deliver_remote = { 26 deliver_remote = {
27 type = "event"; "route/remote"; 27 type = "event"; "route/remote";
28 priority = 0.1;
29 };
30 send_remote = { -- FIXME name
31 type = "filter"; "s2sout";
28 priority = 0.1; 32 priority = 0.1;
29 }; 33 };
30 }; 34 };
31 35
32 local function idsafe(name) 36 local function idsafe(name)
370 local handler, err = compile_handler(handler_code, "mod_firewall::"..chain); 374 local handler, err = compile_handler(handler_code, "mod_firewall::"..chain);
371 if not handler then 375 if not handler then
372 module:log("error", "Compilation error for %s: %s", script, err); 376 module:log("error", "Compilation error for %s: %s", script, err);
373 else 377 else
374 local chain_definition = chains[chain]; 378 local chain_definition = chains[chain];
375 if chain_definition and chain_definition.type == "event" then 379 if chain_definition then
376 for _, event_name in ipairs(chain_definition) do 380 if chain_definition.type == "event" then
377 module:hook(event_name, handler, chain_definition.priority); 381 for _, event_name in ipairs(chain_definition) do
382 module:hook(event_name, handler, chain_definition.priority);
383 end
384 elseif chain_definition.type == "filter" then
385 -- TODO
378 end 386 end
379 elseif not chain:match("^user/") then 387 elseif not chain:match("^user/") then
380 module:log("warn", "Unknown chain %q", chain); 388 module:log("warn", "Unknown chain %q", chain);
381 end 389 end
382 module:hook("firewall/chains/"..chain, handler); 390 module:hook("firewall/chains/"..chain, handler);