aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-27 18:35:33 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-27 18:35:33 +0100
commit1d2aa12ca4afcd02fa1d44df105268d4694d3e6d (patch)
tree5787dde4dbd6b0fdc40f9ce1cc6509d9b9c859e0 /core/moduleapi.lua
parentf51b8f32b0f9031bf30ced4fd4c3f0ad6f6213e8 (diff)
downloadprosody-1d2aa12ca4afcd02fa1d44df105268d4694d3e6d.tar.gz
prosody-1d2aa12ca4afcd02fa1d44df105268d4694d3e6d.zip
moduleapi: Rename module:hook_stanza() -> module:hook_tag() (hook_stanza works for compat)
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 8c57e301..9e8489c2 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -85,7 +85,7 @@ function api:hook_global(event, handler, priority)
return self:hook_object_event(prosody.events, event, handler, priority);
end
-function api:hook_stanza(xmlns, name, handler, priority)
+function api:hook_tag(xmlns, name, handler, priority)
if not handler and type(name) == "function" then
-- If only 2 options then they specified no xmlns
xmlns, name, handler, priority = nil, xmlns, name, handler;
@@ -95,6 +95,7 @@ function api:hook_stanza(xmlns, name, handler, priority)
end
return self:hook("stanza/"..(xmlns and (xmlns..":") or "")..name, function (data) return handler(data.origin, data.stanza, data); end, priority);
end
+api.hook_stanza = api.hook_tag; -- COMPAT w/pre-0.9
function api:require(lib)
local f, n = pluginloader.load_code(self.name, lib..".lib.lua");