# HG changeset patch # User daurnimator # Date 1395252364 14400 # Node ID 9147e566fde0206fff0e04833af3c9f56bc4a9b0 # Parent b8b68d09c9d8f80e8aacdfb58a3170d8e3e17d97 plugins/muc/muc.lib: Tidy up `get_filtered_presence` diff -r b8b68d09c9d8 -r 9147e566fde0 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