Software /
code /
prosody
Changeset
3943:ad5924c31953
util.filters: Add remove_filter_hook()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 22 Dec 2010 16:46:19 +0000 |
parents | 3942:0323beb7183c |
children | 3944:74a422abec11 |
files | util/filters.lua |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/filters.lua Wed Dec 22 16:45:32 2010 +0000 +++ b/util/filters.lua Wed Dec 22 16:46:19 2010 +0000 @@ -76,4 +76,12 @@ 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;