Software /
code /
prosody
Comparison
core/componentmanager.lua @ 1041:07835534d996
core.componentmanager: Fix global access
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 22 Apr 2009 20:52:27 +0100 |
parent | 1004:0c3ea09d6d6e |
child | 1066:0cb325970a50 |
comparison
equal
deleted
inserted
replaced
1040:4c79b28bce64 | 1041:07835534d996 |
---|---|
78 end | 78 end |
79 end | 79 end |
80 | 80 |
81 function create_component(host, component) | 81 function create_component(host, component) |
82 -- TODO check for host well-formedness | 82 -- TODO check for host well-formedness |
83 local session = session or { type = "component", host = host, connected = true, s2sout = {} }; | 83 return { type = "component", host = host, connected = true, s2sout = {} }; |
84 return session; | |
85 end | 84 end |
86 | 85 |
87 function register_component(host, component, session) | 86 function register_component(host, component, session) |
88 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then | 87 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then |
89 components[host] = component; | 88 components[host] = component; |