# HG changeset patch # User Matthew Wild # Date 1293462436 0 # Node ID 8f3499ae1e275a35c95206079f0476d3913676fe # Parent 0f53c88bab9a4f402967d66c3ce24870291f9af8 mod_admin_web: Fix initialisation code, undeclared variable and wrong event scope diff -r 0f53c88bab9a -r 8f3499ae1e27 mod_admin_web/admin_web/mod_admin_web.lua --- a/mod_admin_web/admin_web/mod_admin_web.lua Mon Dec 27 04:24:44 2010 +0000 +++ b/mod_admin_web/admin_web/mod_admin_web.lua Mon Dec 27 15:07:16 2010 +0000 @@ -148,13 +148,13 @@ end function module.load() - local host_session = prosody.hosts[host]; local http_conf = config.get("*", "core", "webadmin_http_ports"); httpserver.new_from_config(http_conf, handle_file_request, { base = "admin" }); end -module:hook("server-started", function () +prosody.events.add_handler("server-started", function () + local host_session = prosody.hosts[host]; if not select(2, hosts[service].modules.pubsub.service:get_nodes(service))[xmlns_s2s_session] then local ok, errmsg = hosts[service].modules.pubsub.service:create(xmlns_s2s_session, service); if not ok then