core/stanza_router.lua
changeset 9530 ced174f29d9a
parent 9073 21730a3642fe
child 10108 3965081809ba
equal deleted inserted replaced
9529:9cc1d7efaa80 9530:ced174f29d9a
    16 
    16 
    17 local full_sessions = _G.prosody.full_sessions;
    17 local full_sessions = _G.prosody.full_sessions;
    18 local bare_sessions = _G.prosody.bare_sessions;
    18 local bare_sessions = _G.prosody.bare_sessions;
    19 
    19 
    20 local core_post_stanza, core_process_stanza, core_route_stanza;
    20 local core_post_stanza, core_process_stanza, core_route_stanza;
    21 
       
    22 local function deprecated_warning(f)
       
    23 	_G[f] = function(...)
       
    24 		log("warn", "Using the global %s() is deprecated, use module:send() or prosody.%s(). %s", f, f, debug.traceback());
       
    25 		return prosody[f](...);
       
    26 	end
       
    27 end
       
    28 deprecated_warning"core_post_stanza";
       
    29 deprecated_warning"core_process_stanza";
       
    30 deprecated_warning"core_route_stanza";
       
    31 
    21 
    32 local valid_stanzas = { message = true, presence = true, iq = true };
    22 local valid_stanzas = { message = true, presence = true, iq = true };
    33 local function handle_unhandled_stanza(host, origin, stanza) --luacheck: ignore 212/host
    23 local function handle_unhandled_stanza(host, origin, stanza) --luacheck: ignore 212/host
    34 	local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns or "jabber:client", origin.type;
    24 	local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns or "jabber:client", origin.type;
    35 	if xmlns == "jabber:client" and valid_stanzas[name] then
    25 	if xmlns == "jabber:client" and valid_stanzas[name] then