aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-05-19 15:39:16 +0100
committerMatthew Wild <mwild1@gmail.com>2012-05-19 15:39:16 +0100
commit28e56af503b1088bf6f62e438e9b06c9e3e1a12f (patch)
treedd7978afcf9041580e40c87400524713966b1a0a /core/moduleapi.lua
parentd964388983926f656fa60b228961aea7c980dcd2 (diff)
downloadprosody-28e56af503b1088bf6f62e438e9b06c9e3e1a12f.tar.gz
prosody-28e56af503b1088bf6f62e438e9b06c9e3e1a12f.zip
modulemanager, moduleapi: Turn module.event_handlers into a multitable and track object->event->handler associations correctly (thanks Zash)
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 96f1d3ea..24d29dfe 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -70,12 +70,7 @@ function api:fire_event(...)
end
function api:hook_object_event(object, event, handler, priority)
- local handlers = self.event_handlers[event];
- if not handlers then
- handlers = {};
- self.event_handlers[event] = handlers;
- end
- handlers[event] = { handler = handler, priority = priority, object = object };
+ self.event_handlers:set(object, event, handler, true);
return object.add_handler(event, handler, priority);
end