From d7084c66513d9ee6c114c55c3bdb92bffd2c68fe Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 31 May 2009 00:51:13 +0500 Subject: modulemanager: module:hook now allows global modules to hook events on the prosody.events object --- core/modulemanager.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modulemanager.lua b/core/modulemanager.lua index 901659f7..59a900f5 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -20,6 +20,7 @@ local register_actions = require "core.actions".register; local st = require "util.stanza"; local hosts = hosts; +local prosody = prosody; local loadfile, pcall = loadfile, pcall; local setmetatable, setfenv, getfenv = setmetatable, setfenv, getfenv; @@ -358,7 +359,7 @@ function api:hook(event, handler) if self.host ~= '*' then hosts[self.host].events.add_handler(event, handler); else - self:log("error", "Global module attempting to hook a host-specific event: %s", event); + prosody.events.add_handler(event, handler); end end -- cgit v1.2.3