comparison mod_host_guard/mod_host_guard.lua @ 727:99f5846bcd85

mod_host_guard: during configuration reload the host handlers should be reinitialized as well, so reverted changed and added back the "redundant code".
author Marco Cirillo <maranda@lightwitch.org>
date Tue, 26 Jun 2012 10:57:24 +0000
parents 455a9b8fac27
children 8ad2e24f5efd
comparison
equal deleted inserted replaced
726:455a9b8fac27 727:99f5846bcd85
62 end 62 end
63 end 63 end
64 64
65 local function init_hosts() 65 local function init_hosts()
66 for n in pairs(hosts) do 66 for n in pairs(hosts) do
67 if guard_blockall:contains(n) or guard_protect:contains(n) then handle_activation(n) end 67 if guard_blockall:contains(n) or guard_protect:contains(n) then
68 -- required as during config:reload() handlers should be reinitialized as well.
69 hosts[n].events.remove_handler("s2sin-established", s2s_hook)
70 hosts[n].events.remove_handler("route/remote", rr_hook)
71 hosts[n].events.remove_handler("stanza/jabber:server:dialback:result", s2s_hook)
72
73 handle_activation(n)
74 end
68 end 75 end
69 end 76 end
70 77
71 local function reload() 78 local function reload()
72 module:log ("debug", "server configuration reloaded, rehashing plugin tables...") 79 module:log ("debug", "server configuration reloaded, rehashing plugin tables...")