Software /
code /
prosody
Changeset
3433:b567ac8e2040
modulemanager: Remove dependency on eventmanager
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 03 Aug 2010 10:52:53 +0100 |
parents | 3432:7f3e45955725 |
children | 3434:428f13c098d5 |
files | core/modulemanager.lua |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/core/modulemanager.lua Tue Aug 03 09:40:06 2010 +0100 +++ b/core/modulemanager.lua Tue Aug 03 10:52:53 2010 +0100 @@ -10,7 +10,6 @@ local logger = require "util.logger"; local log = logger.init("modulemanager"); -local eventmanager = require "core.eventmanager"; local config = require "core.configmanager"; local multitable_new = require "util.multitable".new; local st = require "util.stanza"; @@ -18,6 +17,7 @@ local hosts = hosts; local prosody = prosody; +local prosody_events = prosody.events; local loadfile, pcall, xpcall = loadfile, pcall, xpcall; local setmetatable, setfenv, getfenv = setmetatable, setfenv, getfenv; @@ -104,8 +104,8 @@ end end end -eventmanager.add_event_hook("host-activated", load_modules_for_host); -eventmanager.add_event_hook("component-activated", load_modules_for_host); +prosody_events.add_handler("host-activated", load_modules_for_host); +prosody_events.add_handler("component-activated", load_modules_for_host); -- function load(host, module_name, config) @@ -374,7 +374,7 @@ end; function api:add_event_hook(name, handler) if not hooked:get(self.host, self.name, name) then - eventmanager.add_event_hook(name, function(...) event_hook(self.host, self.name, name, ...); end); + 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);