Software /
code /
prosody
Changeset
6116:9147e566fde0
plugins/muc/muc.lib: Tidy up `get_filtered_presence`
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Wed, 19 Mar 2014 14:06:04 -0400 |
parents | 6115:b8b68d09c9d8 |
children | 6117:d7ade0b00ec5 |
files | plugins/muc/muc.lib.lua |
diffstat | 1 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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