From ec3a5489a4d1ad18a3e8339fa1a2120e79906f81 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 31 May 2009 21:36:12 +0100 Subject: componentmanager: Add events object to registered components if they don't already have one --- core/componentmanager.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/componentmanager.lua') 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); -- cgit v1.2.3