Software / code / prosody
Comparison
core/hostmanager.lua @ 6609:d2faaaca695d
Merge 0.10->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 27 Mar 2015 22:24:57 +0000 |
| parent | 6557:8aa967c81cbc |
| child | 6621:352fa2cae1c9 |
comparison
equal
deleted
inserted
replaced
| 6608:b6e558febb7a | 6609:d2faaaca695d |
|---|---|
| 53 end | 53 end |
| 54 | 54 |
| 55 prosody_events.add_handler("server-starting", load_enabled_hosts); | 55 prosody_events.add_handler("server-starting", load_enabled_hosts); |
| 56 | 56 |
| 57 local function host_send(stanza) | 57 local function host_send(stanza) |
| 58 local name, type = stanza.name, stanza.attr.type; | |
| 59 if type == "error" or (name == "iq" and type == "result") then | |
| 60 local dest_host_name = select(2, jid_split(stanza.attr.to)); | |
| 61 local dest_host = hosts[dest_host_name] or { type = "unknown" }; | |
| 62 log("warn", "Unhandled response sent to %s host %s: %s", dest_host.type, dest_host_name, tostring(stanza)); | |
| 63 return; | |
| 64 end | |
| 65 core_route_stanza(nil, stanza); | 58 core_route_stanza(nil, stanza); |
| 66 end | 59 end |
| 67 | 60 |
| 68 function activate(host, host_config) | 61 function activate(host, host_config) |
| 69 if rawget(hosts, host) then return nil, "The host "..host.." is already activated"; end | 62 if rawget(hosts, host) then return nil, "The host "..host.." is already activated"; end |