comparison mod_firewall/mod_firewall.lua @ 2527:5ff7eb601d60

mod_firewall: Code formatting
author Matthew Wild <mwild1@gmail.com>
date Mon, 20 Feb 2017 09:29:38 +0000
parents b2fc41001c8e
children 44a71584521d
comparison
equal deleted inserted replaced
2526:b2fc41001c8e 2527:5ff7eb601d60
6 local definitions = module:shared("definitions"); 6 local definitions = module:shared("definitions");
7 local active_definitions = { 7 local active_definitions = {
8 ZONE = { 8 ZONE = {
9 -- Default zone that includes all local hosts 9 -- Default zone that includes all local hosts
10 ["$local"] = setmetatable({}, { __index = prosody.hosts }); 10 ["$local"] = setmetatable({}, { __index = prosody.hosts });
11 } 11 };
12 }; 12 };
13 13
14 local default_chains = { 14 local default_chains = {
15 preroute = { 15 preroute = {
16 type = "event"; 16 type = "event";
42 chains[k] = v; 42 chains[k] = v;
43 end 43 end
44 44
45 -- Returns the input if it is safe to be used as a variable name, otherwise nil 45 -- Returns the input if it is safe to be used as a variable name, otherwise nil
46 function idsafe(name) 46 function idsafe(name)
47 return name:match("^%a[%w_]*$") 47 return name:match("^%a[%w_]*$");
48 end 48 end
49 49
50 local meta_funcs = { 50 local meta_funcs = {
51 bare = function (code) 51 bare = function (code)
52 return "jid_bare("..code..")", {"jid_bare"}; 52 return "jid_bare("..code..")", {"jid_bare"};