# HG changeset patch # User Marco Cirillo # Date 1332867420 0 # Node ID ab2a1564da9b6676a65e09bc6fbdc3349bc1524b # Parent 7d4cde86b12e5d72aa8e3a6422ec7f4ac8095bfe mod_compat_muc_admin: adding last missing local (getUsingPath). diff -r 7d4cde86b12e -r ab2a1564da9b mod_compat_muc_admin/mod_compat_muc_admin.lua --- a/mod_compat_muc_admin/mod_compat_muc_admin.lua Tue Mar 27 16:51:59 2012 +0000 +++ b/mod_compat_muc_admin/mod_compat_muc_admin.lua Tue Mar 27 16:57:00 2012 +0000 @@ -36,6 +36,15 @@ return st.presence({type='unavailable', from=stanza.attr.from, to=stanza.attr.to}) :tag('status'):text(error_message); end +local function getUsingPath(stanza, path, getText) + local tag = stanza; + for _, name in ipairs(path) do + if type(tag) ~= 'table' then return; end + tag = tag:child_with_name(name); + end + if tag and getText then tag = table.concat(tag); end + return tag; +end local function getText(stanza, path) return getUsingPath(stanza, path, true); end -- COMPAT: iq condensed function