aboutsummaryrefslogtreecommitdiffstats
path: root/util/events.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-05-06 19:21:18 +0100
committerMatthew Wild <mwild1@gmail.com>2015-05-06 19:21:18 +0100
commit8b320cb39f3d22c7af46d33ddfc017a726db30d0 (patch)
tree52d8d9eeb2d0b0170f870c100ab1754b52692d6f /util/events.lua
parent7b3df2bae66c5081cb53c82f93546b1f28549611 (diff)
downloadprosody-8b320cb39f3d22c7af46d33ddfc017a726db30d0.tar.gz
prosody-8b320cb39f3d22c7af46d33ddfc017a726db30d0.zip
util.events: Add get_handlers() method
Diffstat (limited to 'util/events.lua')
-rw-r--r--util/events.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/events.lua b/util/events.lua
index 79de1151..e93d6204 100644
--- a/util/events.lua
+++ b/util/events.lua
@@ -52,6 +52,9 @@ function new()
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 @@ function new()
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;