Software /
code /
prosody
Changeset
6664:5466f24e51c9
util.events: Add get_handlers() method
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 06 May 2015 19:21:18 +0100 |
parents | 6663:d3023dd07cb6 |
children | 6665:e923d7cb8430 |
files | util/events.lua |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/events.lua Wed May 06 19:20:07 2015 +0100 +++ b/util/events.lua Wed May 06 19:21:18 2015 +0100 @@ -52,6 +52,9 @@ end end end; + local function get_handlers(event) + return handlers[event]; + end; local function add_handlers(handlers) for event, handler in pairs(handlers) do add_handler(event, handler); @@ -134,6 +137,7 @@ remove_handler = remove_handler; add_handlers = add_handlers; remove_handlers = remove_handlers; + get_handlers = get_handlers; wrappers = { add_handler = add_wrapper; remove_handler = remove_wrapper;