Comparison

core/componentmanager.lua @ 1188:fa48e69c4786

core: hosts[*].events
author Waqas Hussain <waqas20@gmail.com>
date Wed, 20 May 2009 05:23:30 +0500
parent 1177:97ecfcec2d71
child 1257:8c9f20d3a17f
comparison
equal deleted inserted replaced
1187:645846375a7b 1188:fa48e69c4786
13 local configmanager = require "core.configmanager"; 13 local configmanager = require "core.configmanager";
14 local eventmanager = require "core.eventmanager"; 14 local eventmanager = require "core.eventmanager";
15 local modulemanager = require "core.modulemanager"; 15 local modulemanager = require "core.modulemanager";
16 local core_route_stanza = core_route_stanza; 16 local core_route_stanza = core_route_stanza;
17 local jid_split = require "util.jid".split; 17 local jid_split = require "util.jid".split;
18 local events_new = require "util.events".new;
18 local st = require "util.stanza"; 19 local st = require "util.stanza";
19 local hosts = hosts; 20 local hosts = hosts;
20 21
21 local pairs, type, tostring = pairs, type, tostring; 22 local pairs, type, tostring = pairs, type, tostring;
22 23
79 end 80 end
80 end 81 end
81 82
82 function create_component(host, component) 83 function create_component(host, component)
83 -- TODO check for host well-formedness 84 -- TODO check for host well-formedness
84 return { type = "component", host = host, connected = true, s2sout = {} }; 85 return { type = "component", host = host, connected = true, s2sout = {}, events = events_new() };
85 end 86 end
86 87
87 function register_component(host, component, session) 88 function register_component(host, component, session)
88 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then 89 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then
89 components[host] = component; 90 components[host] = component;