# HG changeset patch # User Matthew Wild # Date 1243802172 -3600 # Node ID 8c9f20d3a17f3c88750efea27b9ecde81808ce7a # Parent 98f0e9eadf3b4444f9b7ad58c83a2c7da94dd6f0 componentmanager: Add events object to registered components if they don't already have one diff -r 98f0e9eadf3b -r 8c9f20d3a17f core/componentmanager.lua --- 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);