aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-05-31 21:36:12 +0100
committerMatthew Wild <mwild1@gmail.com>2009-05-31 21:36:12 +0100
commitec3a5489a4d1ad18a3e8339fa1a2120e79906f81 (patch)
tree9fec49b67ff41c4236ba8b01d6b94aa0a35fbcf2 /core
parent00f019739ad6aeae86528b62505f44b4037ac113 (diff)
downloadprosody-ec3a5489a4d1ad18a3e8339fa1a2120e79906f81.tar.gz
prosody-ec3a5489a4d1ad18a3e8339fa1a2120e79906f81.zip
componentmanager: Add events object to registered components if they don't already have one
Diffstat (limited to 'core')
-rw-r--r--core/componentmanager.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua
index ff60de28..8f624f15 100644
--- a/core/componentmanager.lua
+++ b/core/componentmanager.lua
@@ -89,6 +89,12 @@ function register_component(host, component, session)
if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then
components[host] = component;
hosts[host] = session or create_component(host, component);
+
+ -- Add events object if not already one
+ if not hosts[host].events then
+ hosts[host].events = events_new();
+ end
+
-- add to disco_items
if not(host:find("@", 1, true) or host:find("/", 1, true)) and host:find(".", 1, true) then
disco_items:set(host:sub(host:find(".", 1, true)+1), host, true);