# HG changeset patch # User Waqas Hussain # Date 1243713073 -18000 # Node ID 4721e4124692658b1a4faabef6741c628fc96077 # Parent 3622ed42b92c91a817b4c6af3bcddb0a3e01af45 modulemanager: module:hook now allows global modules to hook events on the prosody.events object diff -r 3622ed42b92c -r 4721e4124692 core/modulemanager.lua --- 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