aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-09-30 11:05:01 +0100
committerMatthew Wild <mwild1@gmail.com>2009-09-30 11:05:01 +0100
commitf9a8d01543ed2a8ed49ffcf4e9c3f24565a26bdd (patch)
tree8637ce18fa690c63f57e25ab4269d059c3be752a /core
parentafe32590a124663f31b680cce0dd3bfc14f34c4b (diff)
downloadprosody-f9a8d01543ed2a8ed49ffcf4e9c3f24565a26bdd.tar.gz
prosody-f9a8d01543ed2a8ed49ffcf4e9c3f24565a26bdd.zip
componentmanager: Preserve existing events table (if any) when registering a component
Diffstat (limited to 'core')
-rw-r--r--core/componentmanager.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua
index 208f42e4..34f97c25 100644
--- a/core/componentmanager.lua
+++ b/core/componentmanager.lua
@@ -83,9 +83,9 @@ function handle_stanza(origin, stanza)
end
end
-function create_component(host, component)
+function create_component(host, component, events)
-- TODO check for host well-formedness
- return { type = "component", host = host, connected = true, s2sout = {}, events = events_new() };
+ return { type = "component", host = host, connected = true, s2sout = {}, events = events or events_new() };
end
function register_component(host, component, session)
@@ -93,7 +93,7 @@ function register_component(host, component, session)
local old_events = hosts[host] and hosts[host].events;
components[host] = component;
- hosts[host] = session or create_component(host, component);
+ hosts[host] = session or create_component(host, component, old_events);
-- Add events object if not already one
if not hosts[host].events then