From 38f33840a2670fffdb019284b49c5fd23c75a7a4 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 5 Jun 2014 17:07:14 -0400 Subject: plugins/muc: Move 'x' filtering from occupant to util --- plugins/muc/occupant.lib.lua | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'plugins/muc/occupant.lib.lua') diff --git a/plugins/muc/occupant.lib.lua b/plugins/muc/occupant.lib.lua index 6a3f7df4..d59252e2 100644 --- a/plugins/muc/occupant.lib.lua +++ b/plugins/muc/occupant.lib.lua @@ -2,21 +2,10 @@ local next = next; local pairs = pairs; local setmetatable = setmetatable; local st = require "util.stanza"; +local util = module:require "muc/util"; -local get_filtered_presence do - local presence_filters = { - ["http://jabber.org/protocol/muc"] = true; - ["http://jabber.org/protocol/muc#user"] = true; - } - local function presence_filter(tag) - if presence_filters[tag.attr.xmlns] then - return nil; - end - return tag; - end - function get_filtered_presence(stanza) - return st.clone(stanza):maptags(presence_filter); - end +local function get_filtered_presence(stanza) + return util.filter_muc_x(st.clone(stanza)); end local occupant_mt = {}; -- cgit v1.2.3