diff options
author | Matthew Wild <mwild1@gmail.com> | 2014-08-28 09:20:33 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2014-08-28 09:20:33 +0100 |
commit | 856932c1bd3fc217dcf46f9ab9b3658331f00635 (patch) | |
tree | 7ddf642b2da3512449603085c9659ce53bbc65cd /util | |
parent | df5414d79cd020b0c604b120962a208feed57379 (diff) | |
download | prosody-856932c1bd3fc217dcf46f9ab9b3658331f00635.tar.gz prosody-856932c1bd3fc217dcf46f9ab9b3658331f00635.zip |
util.filters: Ignore filters being added twice (fixes issues on removal)
Diffstat (limited to 'util')
-rw-r--r-- | util/filters.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util/filters.lua b/util/filters.lua index d24bd33e..6290e53b 100644 --- a/util/filters.lua +++ b/util/filters.lua @@ -45,6 +45,8 @@ function add_filter(session, type, callback, priority) if not filter_list then filter_list = {}; session.filters[type] = filter_list; + elseif filter_list[callback] then + return; -- Filter already added end priority = priority or 0; |