Sun, 31 May 2009 00:51:13 +0500
modulemanager: module:hook now allows global modules to hook events on the prosody.events object
core/modulemanager.lua | file | annotate | diff | comparison | revisions |
--- a/core/modulemanager.lua Sun May 31 00:46:41 2009 +0500 +++ b/core/modulemanager.lua Sun May 31 00:51:13 2009 +0500 @@ -20,6 +20,7 @@ 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 @@ 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