Changeset

1257:8c9f20d3a17f

componentmanager: Add events object to registered components if they don't already have one
author Matthew Wild <mwild1@gmail.com>
date Sun, 31 May 2009 21:36:12 +0100
parents 1256:98f0e9eadf3b
children 1258:01b69efffb1c
files core/componentmanager.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/componentmanager.lua	Sun May 31 21:35:21 2009 +0100
+++ b/core/componentmanager.lua	Sun May 31 21:36:12 2009 +0100
@@ -89,6 +89,12 @@
 	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);