Comparison

core/modulemanager.lua @ 1167:5620ea24be94

stanza_router: Removed global function core_handle_stanza
author Waqas Hussain <waqas20@gmail.com>
date Sat, 16 May 2009 01:41:45 +0500
parent 1105:965a55db3732
child 1173:09a4cd461673
comparison
equal deleted inserted replaced
1166:5499a028d4ae 1167:5620ea24be94
224 if handlers then 224 if handlers then
225 log("debug", "Passing stanza to mod_%s", handler_info[handlers[1]].name); 225 log("debug", "Passing stanza to mod_%s", handler_info[handlers[1]].name);
226 (handlers[1])(origin, stanza); 226 (handlers[1])(origin, stanza);
227 return true; 227 return true;
228 else 228 else
229 log("debug", "Stanza unhandled by any modules, xmlns: %s", stanza.attr.xmlns); -- we didn't handle it 229 log("debug", "Unhandled %s stanza: %s; xmlns=%s", origin.type, stanza.name, xmlns); -- we didn't handle it
230 if stanza.attr.xmlns == "jabber:client" then
231 if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then
232 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
233 end
234 else
235 origin:close("unsupported-stanza-type");
236 end
230 end 237 end
231 end 238 end
232 239
233 function module_has_method(module, method) 240 function module_has_method(module, method)
234 return type(module.module[method]) == "function"; 241 return type(module.module[method]) == "function";