Changeset

276:27c652363874

mod_ircd: Updated to use events instead of componentmanager.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 10 Nov 2010 21:18:21 +0500
parents 275:9a35c7e2fee4
children 277:07c1c3eaf0c4
files mod_ircd/mod_ircd.lua
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_ircd/mod_ircd.lua	Sun Nov 07 16:03:00 2010 +0000
+++ b/mod_ircd/mod_ircd.lua	Wed Nov 10 21:18:21 2010 +0500
@@ -172,7 +172,20 @@
 	end
 end
 
-require "core.componentmanager".register_component(module.host, irc_component);
+local function stanza_handler(event)
+	irc_component(event.origin, event.stanza);
+	return true;
+end
+module:hook("iq/bare", stanza_handler);
+module:hook("message/bare", stanza_handler);
+module:hook("presence/bare", stanza_handler);
+module:hook("iq/full", stanza_handler);
+module:hook("message/full", stanza_handler);
+module:hook("presence/full", stanza_handler);
+module:hook("iq/host", stanza_handler);
+module:hook("message/host", stanza_handler);
+module:hook("presence/host", stanza_handler);
+require "core.componentmanager".register_component(module.host, function() end); -- COMPAT Prosody 0.7
 
 prosody.events.add_handler("server-stopping", function (shutdown)
 	module:log("debug", "Closing IRC connections prior to shutdown");