# HG changeset patch # User Waqas Hussain # Date 1243718430 -18000 # Node ID c199be608546266ca20c40f9a38f36ca1117746a # Parent 60156584c442b6b08705b056bbf65c6304a21b8c stanza_router: Fire events for non-jabber:client and pre-auth stanzas diff -r 60156584c442 -r c199be608546 core/stanza_router.lua --- a/core/stanza_router.lua Sun May 31 01:17:19 2009 +0500 +++ b/core/stanza_router.lua Sun May 31 02:20:30 2009 +0500 @@ -115,6 +115,20 @@ end core_post_stanza(origin, stanza); else + local h = hosts[stanza.attr.to or origin.host or origin.to_host]; + if h then + local event; + if stanza.attr.xmlns == "jabber:client" then + if stanza.name == "iq" and (stanza.attr.type == "set" or stanza.attr.type == "get") then + event = "stanza/iq/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name; + else + event = "stanza/"..stanza.name; + end + else + event = "stanza/"..stanza.attr.xmlns..":"..stanza.name; + end + if h.events.fire_event(event, {origin = origin, stanza = stanza}) then return; end + end modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza); end end