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 | 355eb83a4a8956be8cf6ffacb94c73d67ed54336 (patch) | |
tree | 765026dae6e50d1f455a6896791ed05b1a45d5b5 /plugins/mod_http.lua | |
parent | a7a312881838cbf9ed374907de2231636df37629 (diff) | |
download | prosody-355eb83a4a8956be8cf6ffacb94c73d67ed54336.tar.gz prosody-355eb83a4a8956be8cf6ffacb94c73d67ed54336.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 |