diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-05-31 21:36:12 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-05-31 21:36:12 +0100 |
commit | ec3a5489a4d1ad18a3e8339fa1a2120e79906f81 (patch) | |
tree | 9fec49b67ff41c4236ba8b01d6b94aa0a35fbcf2 /core/componentmanager.lua | |
parent | 00f019739ad6aeae86528b62505f44b4037ac113 (diff) | |
download | prosody-ec3a5489a4d1ad18a3e8339fa1a2120e79906f81.tar.gz prosody-ec3a5489a4d1ad18a3e8339fa1a2120e79906f81.zip |
componentmanager: Add events object to registered components if they don't already have one
Diffstat (limited to 'core/componentmanager.lua')
-rw-r--r-- | core/componentmanager.lua | 6 |
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); |