Diff

mod_admin_web/admin_web/mod_admin_web.lua @ 304:8f3499ae1e27

mod_admin_web: Fix initialisation code, undeclared variable and wrong event scope
author Matthew Wild <mwild1@gmail.com>
date Mon, 27 Dec 2010 15:07:16 +0000
parent 303:0f53c88bab9a
child 309:5ec9125575fc
line wrap: on
line diff
--- 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