# HG changeset patch # User Marco Cirillo # Date 1328748286 0 # Node ID 36b3ecebdc7e0785a52c732ec151c95c9f2c0a21 # Parent 1004d7176be287a290aa0c57a6712cc0349a9fb0 mod_register_json: de-reverting change to use configmanager again (trace happened), also changed cleanup function name to avoid mismatches (??) diff -r 1004d7176be2 -r 36b3ecebdc7e mod_register_json/mod_register_json.lua --- a/mod_register_json/mod_register_json.lua Thu Feb 09 00:24:31 2012 +0000 +++ b/mod_register_json/mod_register_json.lua Thu Feb 09 00:44:46 2012 +0000 @@ -113,7 +113,7 @@ end -- Set it up! -function cleanup() -- it could be better if module:hook("module-unloaded", ...) actually worked. +function regj_cleanup() -- it could be better if module:hook("module-unloaded", ...) actually worked. module:log("debug", "Cleaning up handlers and stuff as module is being unloaded.") for _, options in ipairs(ports) do if options.port then @@ -122,7 +122,7 @@ end -- if there are no handlers left clean and close the socket, doesn't work with server_event - local event = module:get_option_boolen("use_libevent", false) + local event = require "core.configmanager".get("*", "core", "use_libevent"); if not event then for _, options in ipairs(ports) do @@ -137,7 +137,7 @@ end end - prosody.events.remove_handler("module-unloaded", cleanup) + prosody.events.remove_handler("module-unloaded", regj_cleanup) end function setup() @@ -147,7 +147,7 @@ else ports[id].port = 9443 end elseif options.port == 9280 and options.ssl then ports[id].port = 9443 end end httpserver.new_from_config(ports, handle_req, { base = "register_account" }) - prosody.events.add_handler("module-unloaded", cleanup) + prosody.events.add_handler("module-unloaded", regj_cleanup) end if prosody.start_time then -- already started