Software /
code /
prosody
Comparison
core/stanza_router.lua @ 1419:1ac8bcc63a9d
stanza_router: Fire events also for stanzas to components
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 26 Jun 2009 05:54:03 +0100 |
parent | 1413:b7e17efe433e |
child | 1444:19598161ae22 |
comparison
equal
deleted
inserted
replaced
1418:d14de6cb8b5b | 1419:1ac8bcc63a9d |
---|---|
142 if origin.full_jid then -- c2s connection | 142 if origin.full_jid then -- c2s connection |
143 if hosts[origin.host].events.fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing | 143 if hosts[origin.host].events.fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing |
144 end | 144 end |
145 local h = hosts[to_bare] or hosts[host or origin.host]; | 145 local h = hosts[to_bare] or hosts[host or origin.host]; |
146 if h then | 146 if h then |
147 if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing | |
148 | |
147 if h.type == "component" then | 149 if h.type == "component" then |
148 component_handle_stanza(origin, stanza); | 150 component_handle_stanza(origin, stanza); |
149 return; | 151 return; |
150 else | |
151 if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing | |
152 end | 152 end |
153 if not modules_handle_stanza(h.host, origin, stanza) then | 153 if not modules_handle_stanza(h.host, origin, stanza) then |
154 if stanza.attr.xmlns == "jabber:client" and stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then | 154 if stanza.attr.xmlns == "jabber:client" and stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then |
155 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); | 155 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
156 end | 156 end |