Comparison

core/stanza_router.lua @ 1409:e34cbd9baf8b

stanza_router: Remove some more old routing code
author Waqas Hussain <waqas20@gmail.com>
date Thu, 25 Jun 2009 08:11:05 +0500
parent 1408:9b745496b953
child 1410:b71a9e29adc3
comparison
equal deleted inserted replaced
1408:9b745496b953 1409:e34cbd9baf8b
162 component_handle_stanza(origin, stanza); 162 component_handle_stanza(origin, stanza);
163 return; 163 return;
164 else 164 else
165 if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing 165 if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing
166 end 166 end
167 end 167 if not modules_handle_stanza(h.host, origin, stanza) then
168 168 if stanza.attr.xmlns == "jabber:client" and stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then
169 if host and fire_event(host.."/"..stanza.name, event_data) then 169 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
170 -- event handled 170 end
171 elseif stanza.name == "presence" and origin.host and fire_event(origin.host.."/"..stanza.name, event_data) then 171 end
172 -- event handled
173 elseif not to then
174 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza);
175 elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server
176 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza);
177 elseif hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server
178 component_handle_stanza(origin, stanza);
179 elseif hosts[host] and hosts[host].type == "component" then -- directed at a component
180 component_handle_stanza(origin, stanza);
181 elseif hosts[host] and hosts[host].type == "local" and stanza.name == "iq" and not resource then -- directed at bare JID
182 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza);
183 else 172 else
184 core_route_stanza(origin, stanza); 173 core_route_stanza(origin, stanza);
185 end 174 end
186 end 175 end
187 176