modulemanager: module:hook now allows global modules to hook events on the prosody.events object

Sun, 31 May 2009 00:51:13 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 31 May 2009 00:51:13 +0500
changeset 1247
4721e4124692
parent 1246
3622ed42b92c
child 1248
9a482f76a20a

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
 

mercurial