# HG changeset patch # User Matthew Wild # Date 1369126139 -3600 # Node ID e043d4d65423ca2559d26f8e010abbb6e1710724 # Parent f73d5fb4ea132075a5986a65700145ab5747b354 mod_muc: Replace getText() with get_child_text(), 1 insertion, 12 deletions! diff -r f73d5fb4ea13 -r e043d4d65423 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Mon May 20 15:33:57 2013 +0100 +++ b/plugins/muc/muc.lib.lua Tue May 21 09:48:59 2013 +0100 @@ -72,17 +72,6 @@ local cond = get_error_condition(stanza); return kickable_error_conditions[cond] and cond; 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 getTag(stanza, path) return getUsingPath(stanza, path); end -local function getText(stanza, path) return getUsingPath(stanza, path, true); end ----------- local room_mt = {}; @@ -867,7 +856,7 @@ else local from = stanza.attr.from; stanza.attr.from = current_nick; - local subject = getText(stanza, {"subject"}); + local subject = stanza:get_child_text("subject"); if subject then if occupant.role == "moderator" or ( self._data.changesubject and occupant.role == "participant" ) then -- and participant