aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-03-19 14:06:04 -0400
committerdaurnimator <quae@daurnimator.com>2014-03-19 14:06:04 -0400
commit38d1a05fee92a320301db02dfc189f5138fccfc7 (patch)
treefaea3bdb5d35f8169a6ed9c3c8e0887d57e4d45f /plugins/muc
parent37e1117b7809b10db45ecbd2e9eb3cfa957ec652 (diff)
downloadprosody-38d1a05fee92a320301db02dfc189f5138fccfc7.tar.gz
prosody-38d1a05fee92a320301db02dfc189f5138fccfc7.zip
plugins/muc/muc.lib: Tidy up `get_filtered_presence`
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua21
1 files changed, 13 insertions, 8 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 2d45f17e..2fb1a34e 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -27,15 +27,20 @@ local md5 = require "util.hashes".md5;
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
+ function get_filtered_presence(stanza)
+ return st.clone(stanza):maptags(presence_filter);
end
- return tag;
-end
-local function get_filtered_presence(stanza)
- return st.clone(stanza):maptags(presence_filter);
end
local is_kickable_error do