aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-12-22 16:46:19 +0000
committerMatthew Wild <mwild1@gmail.com>2010-12-22 16:46:19 +0000
commitf050d463d41893bc552756723a937c05ff5988ed (patch)
treedac4d0587696eae013195ad2bf183fd81609d833
parent18972368fe1a471b367b528058e399dfaf42e377 (diff)
downloadprosody-f050d463d41893bc552756723a937c05ff5988ed.tar.gz
prosody-f050d463d41893bc552756723a937c05ff5988ed.zip
util.filters: Add remove_filter_hook()
-rw-r--r--util/filters.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/filters.lua b/util/filters.lua
index f304e71a..d143666b 100644
--- a/util/filters.lua
+++ b/util/filters.lua
@@ -76,4 +76,12 @@ function add_filter_hook(callback)
t_insert(new_filter_hooks, callback);
end
+function remove_filter_hook(callback)
+ for i=1,#new_filter_hooks do
+ if new_filter_hooks[i] == callback then
+ t_remove(new_filter_hooks, i);
+ end
+ end
+end
+
return _M;