Merge 0.10->trunk
[prosody.git] / plugins / muc / util.lib.lua
index 90a3a1836775964cfc230d41f987babfd6944272..16deb543e1a94e2c055d78e295755b7e2b874ec5 100644 (file)
@@ -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;