# HG changeset patch # User Marco Cirillo # Date 1347477345 0 # Node ID b16b291d68c33f1ce453cacb56966d48f526ce0f # Parent 881ec9919144d618a309c7f70e6d0c0e8b9a95b7 mod_host_guard: prevent possible traceback during host manual activation/deactivation. diff -r 881ec9919144 -r b16b291d68c3 mod_host_guard/mod_host_guard.lua --- a/mod_host_guard/mod_host_guard.lua Thu Sep 13 00:08:29 2012 +0500 +++ b/mod_host_guard/mod_host_guard.lua Wed Sep 12 19:15:45 2012 +0000 @@ -42,7 +42,7 @@ local function handle_activation (host, u) if guard_blockall:contains(host) or guard_protect:contains(host) then - if hosts[host] and hosts[host].events then + if hosts[host] and hosts[host].events and (hosts[host].modules and not hosts[host].modules["auth_anonymous"]) then hosts[host].events.add_handler("s2sin-established", s2s_hook, 500) hosts[host].events.add_handler("route/remote", rr_hook, 500) hosts[host].events.add_handler("stanza/jabber:server:dialback:result", s2s_hook, 500) @@ -57,7 +57,7 @@ local function handle_deactivation (host, u, i) if guard_blockall:contains(host) or guard_protect:contains(host) then - if hosts[host] and hosts[host].events then + if hosts[host] and hosts[host].events and (hosts[host].modules and not hosts[host].modules["auth_anonymous"]) then hosts[host].events.remove_handler("s2sin-established", s2s_hook) hosts[host].events.remove_handler("route/remote", rr_hook) hosts[host].events.remove_handler("stanza/jabber:server:dialback:result", s2s_hook)