diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-04-26 05:40:04 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-04-26 05:40:04 +0100 |
commit | 93f86e22d518f59c5b821eaaa778bbc2f538e4f7 (patch) | |
tree | 765026dae6e50d1f455a6896791ed05b1a45d5b5 /plugins/mod_http.lua | |
parent | 4b51577e133576fb52fcae3afb46ac98c3dc4cc4 (diff) | |
download | prosody-93f86e22d518f59c5b821eaaa778bbc2f538e4f7.tar.gz prosody-93f86e22d518f59c5b821eaaa778bbc2f538e4f7.zip |
mod_http: Use module:hook/unhook_event_object() so that handlers get unregistered if mod_http is unloaded
Diffstat (limited to 'plugins/mod_http.lua')
-rw-r--r-- | plugins/mod_http.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua index 6da4db24..2ba69cb5 100644 --- a/plugins/mod_http.lua +++ b/plugins/mod_http.lua @@ -57,7 +57,7 @@ function module.add_host(module) end if not app_handlers[event_name] then app_handlers[event_name] = handler; - server.add_handler(event_name, handler); + module:hook_object_event(server, event_name, handler); else module:log("warn", "App %s added handler twice for '%s', ignoring", app_name, event_name); end @@ -71,7 +71,7 @@ function module.add_host(module) local app_handlers = apps[event.item.name]; apps[event.item.name] = nil; for event, handler in pairs(app_handlers) do - server.remove_handler(event, handler); + module:unhook_object_event(server, event, handler); end end |