Comparison

plugins/muc/util.lib.lua @ 6271:006b0e0f0de2

plugins/muc: Move 'x' filtering from occupant to util
author daurnimator <quae@daurnimator.com>
date Thu, 05 Jun 2014 17:07:14 -0400
parent 6218:bf11910bad5a
child 9599:5a2135964ed3
comparison
equal deleted inserted replaced
6270:ee2d5b2a263d 6271:006b0e0f0de2
39 function _M.is_kickable_error(stanza) 39 function _M.is_kickable_error(stanza)
40 local cond = select(2, stanza:get_error()) or "malformed error"; 40 local cond = select(2, stanza:get_error()) or "malformed error";
41 return kickable_error_conditions[cond]; 41 return kickable_error_conditions[cond];
42 end 42 end
43 43
44 local muc_x_filters = {
45 ["http://jabber.org/protocol/muc"] = true;
46 ["http://jabber.org/protocol/muc#user"] = true;
47 }
48 local function muc_x_filter(tag)
49 if muc_x_filters[tag.attr.xmlns] then
50 return nil;
51 end
52 return tag;
53 end
54 function _M.filter_muc_x(stanza)
55 return stanza:maptags(muc_x_filter);
56 end
57
44 return _M; 58 return _M;