71 -- hasn't been configured |
71 -- hasn't been configured |
72 session:close{ condition = "host-unknown", text = tostring(attr.to).." does not match any configured external components" }; |
72 session:close{ condition = "host-unknown", text = tostring(attr.to).." does not match any configured external components" }; |
73 return; |
73 return; |
74 end |
74 end |
75 |
75 |
76 -- Store the original host (this is used for config, etc.) |
|
77 session.user = attr.to; |
|
78 -- Set the host for future reference |
|
79 session.host = config.get(attr.to, "core", "component_address") or attr.to; |
|
80 -- Note that we don't create the internal component |
76 -- Note that we don't create the internal component |
81 -- until after the external component auths successfully |
77 -- until after the external component auths successfully |
82 |
78 |
|
79 session.host = attr.to; |
83 session.streamid = uuid_gen(); |
80 session.streamid = uuid_gen(); |
84 session.notopen = nil; |
81 session.notopen = nil; |
85 |
82 |
86 session.send(st.stanza("stream:stream", { xmlns=xmlns_component, |
83 session.send(st.stanza("stream:stream", { xmlns=xmlns_component, |
87 ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.host }):top_tag()); |
84 ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.host }):top_tag()); |