comparison mod_ircd/mod_ircd.lua @ 282:e5cc0fe5eec3

mod_ircd: Give stanza handlers a negative priority, to allow mod_iq to process them first.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 02 Dec 2010 16:23:22 +0500
parents 27c652363874
children 282abba844e8
comparison
equal deleted inserted replaced
281:e5c16c87383c 282:e5cc0fe5eec3
174 174
175 local function stanza_handler(event) 175 local function stanza_handler(event)
176 irc_component(event.origin, event.stanza); 176 irc_component(event.origin, event.stanza);
177 return true; 177 return true;
178 end 178 end
179 module:hook("iq/bare", stanza_handler); 179 module:hook("iq/bare", stanza_handler, -1);
180 module:hook("message/bare", stanza_handler); 180 module:hook("message/bare", stanza_handler, -1);
181 module:hook("presence/bare", stanza_handler); 181 module:hook("presence/bare", stanza_handler, -1);
182 module:hook("iq/full", stanza_handler); 182 module:hook("iq/full", stanza_handler, -1);
183 module:hook("message/full", stanza_handler); 183 module:hook("message/full", stanza_handler, -1);
184 module:hook("presence/full", stanza_handler); 184 module:hook("presence/full", stanza_handler, -1);
185 module:hook("iq/host", stanza_handler); 185 module:hook("iq/host", stanza_handler, -1);
186 module:hook("message/host", stanza_handler); 186 module:hook("message/host", stanza_handler, -1);
187 module:hook("presence/host", stanza_handler); 187 module:hook("presence/host", stanza_handler, -1);
188 require "core.componentmanager".register_component(module.host, function() end); -- COMPAT Prosody 0.7 188 require "core.componentmanager".register_component(module.host, function() end); -- COMPAT Prosody 0.7
189 189
190 prosody.events.add_handler("server-stopping", function (shutdown) 190 prosody.events.add_handler("server-stopping", function (shutdown)
191 module:log("debug", "Closing IRC connections prior to shutdown"); 191 module:log("debug", "Closing IRC connections prior to shutdown");
192 for channel, joined_muc in pairs(joined_mucs) do 192 for channel, joined_muc in pairs(joined_mucs) do