diff options
author | daurnimator <quae@daurnimator.com> | 2014-03-19 14:06:04 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-03-19 14:06:04 -0400 |
commit | bd65d4b2a15b57bd65f1167261825325d0917708 (patch) | |
tree | faea3bdb5d35f8169a6ed9c3c8e0887d57e4d45f | |
parent | de9f31f2e7be51c92fbf096465212e40ce4548d3 (diff) | |
download | prosody-bd65d4b2a15b57bd65f1167261825325d0917708.tar.gz prosody-bd65d4b2a15b57bd65f1167261825325d0917708.zip |
plugins/muc/muc.lib: Tidy up `get_filtered_presence`
-rw-r--r-- | plugins/muc/muc.lib.lua | 21 |
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 |