# HG changeset patch # User Marco Cirillo # Date 1347480528 0 # Node ID f826b5935175d32bc9058653361204a7da39648d # Parent 960007b0901e57faf56983e78c1da73b111b3e93 mod_host_guard: replace checking host object with checking the configuration for the authentication option set to anonymous, I suppose that was the reason I imported configmanager but probably lost that somewhere in the process. diff -r 960007b0901e -r f826b5935175 mod_host_guard/mod_host_guard.lua --- a/mod_host_guard/mod_host_guard.lua Thu Sep 13 00:17:42 2012 +0500 +++ b/mod_host_guard/mod_host_guard.lua Wed Sep 12 20:08:48 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 and (hosts[host].modules and not hosts[host].modules["auth_anonymous"]) then + if hosts[host] and config.get(host, "core", "authentication") == "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 and (hosts[host].modules and not hosts[host].modules["auth_anonymous"]) then + if hosts[host] and config.get(host, "core", "authentication") == "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)