aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/util.lib.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-06-05 17:07:14 -0400
committerdaurnimator <quae@daurnimator.com>2014-06-05 17:07:14 -0400
commit38f33840a2670fffdb019284b49c5fd23c75a7a4 (patch)
tree87cbe024b36c3991e170e4ecc1164bf31a8344d2 /plugins/muc/util.lib.lua
parentcc0208bd0602f2472db06cd8d54e988c782f2891 (diff)
downloadprosody-38f33840a2670fffdb019284b49c5fd23c75a7a4.tar.gz
prosody-38f33840a2670fffdb019284b49c5fd23c75a7a4.zip
plugins/muc: Move 'x' filtering from occupant to util
Diffstat (limited to 'plugins/muc/util.lib.lua')
-rw-r--r--plugins/muc/util.lib.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/muc/util.lib.lua b/plugins/muc/util.lib.lua
index 90a3a183..16deb543 100644
--- a/plugins/muc/util.lib.lua
+++ b/plugins/muc/util.lib.lua
@@ -41,4 +41,18 @@ function _M.is_kickable_error(stanza)
return kickable_error_conditions[cond];
end
+local muc_x_filters = {
+ ["http://jabber.org/protocol/muc"] = true;
+ ["http://jabber.org/protocol/muc#user"] = true;
+}
+local function muc_x_filter(tag)
+ if muc_x_filters[tag.attr.xmlns] then
+ return nil;
+ end
+ return tag;
+end
+function _M.filter_muc_x(stanza)
+ return stanza:maptags(muc_x_filter);
+end
+
return _M;