# HG changeset patch # User Waqas Hussain # Date 1242779010 -18000 # Node ID fa48e69c4786f089eaa3e0838cb857cf69081b55 # Parent 645846375a7b5eb23e0afb3fb87760e0be86a85e core: hosts[*].events diff -r 645846375a7b -r fa48e69c4786 core/componentmanager.lua --- a/core/componentmanager.lua Tue May 19 13:07:13 2009 +0100 +++ b/core/componentmanager.lua Wed May 20 05:23:30 2009 +0500 @@ -15,6 +15,7 @@ local modulemanager = require "core.modulemanager"; local core_route_stanza = core_route_stanza; local jid_split = require "util.jid".split; +local events_new = require "util.events".new; local st = require "util.stanza"; local hosts = hosts; @@ -81,7 +82,7 @@ function create_component(host, component) -- TODO check for host well-formedness - return { type = "component", host = host, connected = true, s2sout = {} }; + return { type = "component", host = host, connected = true, s2sout = {}, events = events_new() }; end function register_component(host, component, session) diff -r 645846375a7b -r fa48e69c4786 core/hostmanager.lua --- a/core/hostmanager.lua Tue May 19 13:07:13 2009 +0100 +++ b/core/hostmanager.lua Wed May 20 05:23:30 2009 +0500 @@ -2,6 +2,7 @@ local hosts = hosts; local configmanager = require "core.configmanager"; local eventmanager = require "core.eventmanager"; +local events_new = require "util.events".new; local log = require "util.logger".init("hostmanager"); @@ -26,7 +27,7 @@ eventmanager.add_event_hook("server-starting", load_enabled_hosts); function activate(host, host_config) - hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {} }; + hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {}, events = events_new() }; log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host); eventmanager.fire_event("host-activated", host, host_config); end