mod_ircd: Updated to use events instead of componentmanager.
authorWaqas Hussain <waqas20@gmail.com>
Wed, 10 Nov 2010 21:18:21 +0500
changeset 276 27c652363874
parent 275 9a35c7e2fee4
child 277 07c1c3eaf0c4
mod_ircd: Updated to use events instead of componentmanager.
mod_ircd/mod_ircd.lua
--- 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");