diff options
author | Kim Alvefur <zash@zash.se> | 2012-07-26 04:30:30 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-07-26 04:30:30 +0200 |
commit | 6576b53bed0e9f7d0a4d0ee9bb300093e81024df (patch) | |
tree | de61527e3cb378b6722b021f7b7c2ca63e18e442 /core | |
parent | efbe1587526ef281b0b5661e2828edd59448f5dc (diff) | |
download | prosody-6576b53bed0e9f7d0a4d0ee9bb300093e81024df.tar.gz prosody-6576b53bed0e9f7d0a4d0ee9bb300093e81024df.zip |
stanza_router: Warn if the global core_*_stanza() functions are called
Diffstat (limited to 'core')
-rw-r--r-- | core/stanza_router.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index f01c0fee..94753678 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -17,6 +17,18 @@ local jid_prepped_split = require "util.jid".prepped_split; 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 |