Comparison

core/stanza_router.lua @ 1168:dd523bfc9ea9

Dropped support for resource based components
author Waqas Hussain <waqas20@gmail.com>
date Sat, 16 May 2009 02:07:27 +0500
parent 1167:5620ea24be94
child 1169:fdc68aec1d49
comparison
equal deleted inserted replaced
1167:5620ea24be94 1168:dd523bfc9ea9
114 -- event handled 114 -- event handled
115 elseif not to then 115 elseif not to then
116 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza); 116 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza);
117 elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server 117 elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server
118 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza); 118 modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza);
119 elseif hosts[to] and hosts[to].type == "component" then -- hack to allow components to handle node@server/resource and server/resource
120 component_handle_stanza(origin, stanza);
121 elseif hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server 119 elseif hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server
122 component_handle_stanza(origin, stanza); 120 component_handle_stanza(origin, stanza);
123 elseif hosts[host] and hosts[host].type == "component" then -- directed at a component 121 elseif hosts[host] and hosts[host].type == "component" then -- directed at a component
124 component_handle_stanza(origin, stanza); 122 component_handle_stanza(origin, stanza);
125 elseif hosts[host] and hosts[host].type == "local" and stanza.name == "iq" and not resource then -- directed at bare JID 123 elseif hosts[host] and hosts[host].type == "local" and stanza.name == "iq" and not resource then -- directed at bare JID
146 144
147 -- Auto-detect origin if not specified 145 -- Auto-detect origin if not specified
148 origin = origin or hosts[from_host]; 146 origin = origin or hosts[from_host];
149 if not origin then return false; end 147 if not origin then return false; end
150 148
151 if hosts[to] and hosts[to].type == "component" then -- hack to allow components to handle node@server/resource and server/resource 149 if hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server
152 return component_handle_stanza(origin, stanza);
153 elseif hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server
154 return component_handle_stanza(origin, stanza); 150 return component_handle_stanza(origin, stanza);
155 elseif hosts[host] and hosts[host].type == "component" then -- directed at a component 151 elseif hosts[host] and hosts[host].type == "component" then -- directed at a component
156 return component_handle_stanza(origin, stanza); 152 return component_handle_stanza(origin, stanza);
157 end 153 end
158 154