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 |