Mercurial > prosody-hg
comparison core/componentmanager.lua @ 3547:3242e70f1058
componentmanager: Removed an unused third parameter from the register_component function.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Tue, 02 Nov 2010 04:29:54 +0500 |
| parents | bc139431830b |
| children | 579c087059fc |
comparison
equal
deleted
inserted
replaced
| 3546:cb1600dea3ad | 3547:3242e70f1058 |
|---|---|
| 96 ssl_ctx = ssl_ctx, ssl_ctx_in = ssl_ctx_in, events = events or events_new(), | 96 ssl_ctx = ssl_ctx, ssl_ctx_in = ssl_ctx_in, events = events or events_new(), |
| 97 dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen(), | 97 dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen(), |
| 98 disallow_s2s = configmanager.get(host, "core", "disallow_s2s"); }; | 98 disallow_s2s = configmanager.get(host, "core", "disallow_s2s"); }; |
| 99 end | 99 end |
| 100 | 100 |
| 101 function register_component(host, component, session) | 101 function register_component(host, component) |
| 102 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then | 102 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then |
| 103 local old_events = hosts[host] and hosts[host].events; | 103 local old_events = hosts[host] and hosts[host].events; |
| 104 | 104 |
| 105 components[host] = component; | 105 components[host] = component; |
| 106 hosts[host] = session or create_component(host, component, old_events); | 106 hosts[host] = create_component(host, component, old_events); |
| 107 | 107 |
| 108 -- Add events object if not already one | 108 -- Add events object if not already one |
| 109 if not hosts[host].events then | 109 if not hosts[host].events then |
| 110 hosts[host].events = old_events or events_new(); | 110 hosts[host].events = old_events or events_new(); |
| 111 end | 111 end |
| 119 disco_items:set(host:sub(host:find(".", 1, true)+1), host, true); | 119 disco_items:set(host:sub(host:find(".", 1, true)+1), host, true); |
| 120 end | 120 end |
| 121 modulemanager.load(host, "dialback"); | 121 modulemanager.load(host, "dialback"); |
| 122 modulemanager.load(host, "tls"); | 122 modulemanager.load(host, "tls"); |
| 123 log("debug", "component added: "..host); | 123 log("debug", "component added: "..host); |
| 124 return session or hosts[host]; | 124 return hosts[host]; |
| 125 else | 125 else |
| 126 log("error", "Attempt to set component for existing host: "..host); | 126 log("error", "Attempt to set component for existing host: "..host); |
| 127 end | 127 end |
| 128 end | 128 end |
| 129 | 129 |
