aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-05-21 09:48:59 +0100
committerMatthew Wild <mwild1@gmail.com>2013-05-21 09:48:59 +0100
commit93b9f09b8609020e5efb31b239acab60aa71ff08 (patch)
treecb10cbf6da2ee8134ae85bd76c2a5efcd3cc35b1 /plugins
parent572e00f29c746a9d386a719c1a76314dcb1e9e5d (diff)
downloadprosody-93b9f09b8609020e5efb31b239acab60aa71ff08.tar.gz
prosody-93b9f09b8609020e5efb31b239acab60aa71ff08.zip
mod_muc: Replace getText() with get_child_text(), 1 insertion, 12 deletions!
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua13
1 files changed, 1 insertions, 12 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 68e36e83..4867b941 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -72,17 +72,6 @@ local function is_kickable_error(stanza)
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 @@ function room_mt:handle_to_room(origin, stanza) -- presence changes and groupcha
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