Software /
code /
prosody
Diff
util/filters.lua @ 4015:a35fa3368626
util.filters: Add remove_filter_hook()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 22 Dec 2010 16:46:19 +0000 |
parent | 3625:f8d61da5bcc1 |
child | 5776:bd0ff8ae98a8 |
child | 5849:8f451d370dd4 |
line wrap: on
line diff
--- a/util/filters.lua Tue Dec 21 22:26:22 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;