plugins/muc/muc.lib: Tidy up `get_filtered_presence`
authordaurnimator <quae@daurnimator.com>
Wed, 19 Mar 2014 14:06:04 -0400
changeset 6116 9147e566fde0
parent 6115 b8b68d09c9d8
child 6117 d7ade0b00ec5
plugins/muc/muc.lib: Tidy up `get_filtered_presence`
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Wed Mar 19 13:59:59 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Wed Mar 19 14:06:04 2014 -0400
@@ -27,15 +27,20 @@
 
 local default_history_length, max_history_length = 20, math.huge;
 
-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;
+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
-	return tag;
-end
-local function get_filtered_presence(stanza)
-	return st.clone(stanza):maptags(presence_filter);
+	function get_filtered_presence(stanza)
+		return st.clone(stanza):maptags(presence_filter);
+	end
 end
 
 local is_kickable_error do