diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-12-22 16:46:19 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-12-22 16:46:19 +0000 |
commit | f050d463d41893bc552756723a937c05ff5988ed (patch) | |
tree | dac4d0587696eae013195ad2bf183fd81609d833 /util | |
parent | 18972368fe1a471b367b528058e399dfaf42e377 (diff) | |
download | prosody-f050d463d41893bc552756723a937c05ff5988ed.tar.gz prosody-f050d463d41893bc552756723a937c05ff5988ed.zip |
util.filters: Add remove_filter_hook()
Diffstat (limited to 'util')
-rw-r--r-- | util/filters.lua | 8 |
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; |