diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-10-16 08:15:11 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-10-16 08:15:11 +0500 |
commit | 9cbf9dc9d6978298ac5503e57a725dadd7a55132 (patch) | |
tree | f84c6ec8df57bfb9121a97f7ff84b01ea2ed4149 /core/modulemanager.lua | |
parent | e981541bc4bec6067cd5c406bfbd71de97b75964 (diff) | |
download | prosody-9cbf9dc9d6978298ac5503e57a725dadd7a55132.tar.gz prosody-9cbf9dc9d6978298ac5503e57a725dadd7a55132.zip |
modulemanager: Removed another legacy events API (add_event_hook), and related code.
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r-- | core/modulemanager.lua | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua index c0bd36bb..55cb06d1 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -53,9 +53,7 @@ local modulemap = { ["*"] = {} }; local modulehelpers = setmetatable({}, { __index = _G }); -local hooked = multitable_new(); local hooks = multitable_new(); -local event_hooks = multitable_new(); local NULL = {}; @@ -188,7 +186,6 @@ function unload(host, name, ...) log("warn", "Non-fatal error unloading module '%s' on '%s': %s", name, host, err); end end - event_hooks:remove(host, name); -- unhook event handlers hooked by module:hook for event, handlers in pairs(hooks:get(host, name) or NULL) do for handler in pairs(handlers or NULL) do @@ -319,20 +316,6 @@ function api:add_identity(category, type, name) self:add_item("identity", {category = category, type = type, name = name}); end -local event_hook = function(host, mod_name, event_name, ...) - if type((...)) == "table" and (...).host and (...).host ~= host then return; end - for handler in pairs(event_hooks:get(host, mod_name, event_name) or NULL) do - handler(...); - end -end; -function api:add_event_hook(name, handler) - if not hooked:get(self.host, self.name, name) then - prosody_events.add_handler(name, function(...) event_hook(self.host, self.name, name, ...); end); - hooked:set(self.host, self.name, name, true); - end - event_hooks:set(self.host, self.name, name, handler, true); -end - function api:fire_event(...) return (hosts[self.host] or prosody).events.fire_event(...); end |