Software /
code /
prosody
Changeset
4719:2087d42f1e77
moduleapi: Rename module:hook_stanza() -> module:hook_tag() (hook_stanza works for compat)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 27 Apr 2012 18:35:33 +0100 |
parents | 4718:a9f6088a83e3 |
children | 4720:fddc2797a96a |
files | core/moduleapi.lua |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/core/moduleapi.lua Fri Apr 27 18:34:40 2012 +0100 +++ b/core/moduleapi.lua Fri Apr 27 18:35:33 2012 +0100 @@ -85,7 +85,7 @@ 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 @@ 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");