# HG changeset patch # User Kim Alvefur # Date 1343269830 -7200 # Node ID d59c842fe38ed02eeaf3601c54d2a761fb102adc # Parent 83b4d3727b4fc40e9448a249c65741d479fb5725 stanza_router: Warn if the global core_*_stanza() functions are called diff -r 83b4d3727b4f -r d59c842fe38e core/stanza_router.lua --- a/core/stanza_router.lua Thu Jul 26 02:27:24 2012 +0200 +++ b/core/stanza_router.lua Thu Jul 26 04:30:30 2012 +0200 @@ -17,6 +17,18 @@ local full_sessions = _G.prosody.full_sessions; local bare_sessions = _G.prosody.bare_sessions; +local core_post_stanza, core_process_stanza, core_route_stanza; + +function deprecated_warning(f) + _G[f] = function(...) + log("warn", "Using the global %s() is deprecated, use module:send() or prosody.%s(). %s", f, f, debug.traceback()); + return prosody[f](...); + end +end +deprecated_warning"core_post_stanza"; +deprecated_warning"core_process_stanza"; +deprecated_warning"core_route_stanza"; + local function handle_unhandled_stanza(host, origin, stanza) local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns or "jabber:client", origin.type; if name == "iq" and xmlns == "jabber:client" then