aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2014-08-28 09:20:33 +0100
committerMatthew Wild <mwild1@gmail.com>2014-08-28 09:20:33 +0100
commitb27e7b3834519214f9b3c9e6e041421429bbcc74 (patch)
tree7ddf642b2da3512449603085c9659ce53bbc65cd
parent27c737e5ff7b8a4834c3cd45cff1937a22b4185c (diff)
downloadprosody-b27e7b3834519214f9b3c9e6e041421429bbcc74.tar.gz
prosody-b27e7b3834519214f9b3c9e6e041421429bbcc74.zip
util.filters: Ignore filters being added twice (fixes issues on removal)0.9.5
-rw-r--r--util/filters.lua2
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;