aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-05-20 05:23:30 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-05-20 05:23:30 +0500
commit6b5592e19879047d6e3cd738862a5a155d53f98c (patch)
treef615d27b728c59f82063e38da42619a9b728c486
parent8cca61ebde8108135a8b38a5896880ca2a4e5a40 (diff)
downloadprosody-6b5592e19879047d6e3cd738862a5a155d53f98c.tar.gz
prosody-6b5592e19879047d6e3cd738862a5a155d53f98c.zip
core: hosts[*].events
-rw-r--r--core/componentmanager.lua3
-rw-r--r--core/hostmanager.lua3
2 files changed, 4 insertions, 2 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua
index 2053bff4..ff60de28 100644
--- a/core/componentmanager.lua
+++ b/core/componentmanager.lua
@@ -15,6 +15,7 @@ local eventmanager = require "core.eventmanager";
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 @@ end
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 --git a/core/hostmanager.lua b/core/hostmanager.lua
index 97c742da..a72e5f61 100644
--- a/core/hostmanager.lua
+++ b/core/hostmanager.lua
@@ -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 @@ end
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