# HG changeset patch # User Waqas Hussain # Date 1289405901 -18000 # Node ID 27c652363874ab1fbef02124ba76594f3a7f7aa4 # Parent 9a35c7e2fee48df03526e572943e1f57893752cc mod_ircd: Updated to use events instead of componentmanager. diff -r 9a35c7e2fee4 -r 27c652363874 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");