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
commit7513fb3ead3b5a6d4c4d790b64d1801643cea20d (patch)
tree17f3b509ebc4d9639cece0a53445c8168ca87936
parent45dee16625588cdc7dcf285dc51f209d6897c0cb (diff)
downloadprosody-7513fb3ead3b5a6d4c4d790b64d1801643cea20d.tar.gz
prosody-7513fb3ead3b5a6d4c4d790b64d1801643cea20d.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;