Software /
code /
prosody
Comparison
core/moduleapi.lua @ 11921:89aef37fca54
core.moduleapi: Fix name of renamed API in log message
hook_stanza was renamed hook_tag in 2012 in 2087d42f1e77
Why do we still have hook_stanza?
Why is this only a warning anyway?
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Nov 2021 16:26:54 +0100 |
parent | 11823:36a7a3137d41 |
child | 11931:c65d5da8e99a |
comparison
equal
deleted
inserted
replaced
11920:ff4e34c448a4 | 11921:89aef37fca54 |
---|---|
102 function api:hook_tag(xmlns, name, handler, priority) | 102 function api:hook_tag(xmlns, name, handler, priority) |
103 if not handler and type(name) == "function" then | 103 if not handler and type(name) == "function" then |
104 -- If only 2 options then they specified no xmlns | 104 -- If only 2 options then they specified no xmlns |
105 xmlns, name, handler, priority = nil, xmlns, name, handler; | 105 xmlns, name, handler, priority = nil, xmlns, name, handler; |
106 elseif not (handler and name) then | 106 elseif not (handler and name) then |
107 self:log("warn", "Error: Insufficient parameters to module:hook_stanza()"); | 107 self:log("warn", "Error: Insufficient parameters to module:hook_tag()"); |
108 return; | 108 return; |
109 end | 109 end |
110 return self:hook("stanza/"..(xmlns and (xmlns..":") or "")..name, | 110 return self:hook("stanza/"..(xmlns and (xmlns..":") or "")..name, |
111 function (data) return handler(data.origin, data.stanza, data); end, priority); | 111 function (data) return handler(data.origin, data.stanza, data); end, priority); |
112 end | 112 end |