119 session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)}; |
119 session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)}; |
120 return; |
120 return; |
121 end |
121 end |
122 |
122 |
123 |
123 |
124 local features = {}; |
124 local features = st.stanza("stream:features"); |
125 modulemanager.fire_event("stream-features", session, features); |
125 modulemanager.fire_event("stream-features", session, features); |
126 |
126 |
127 -- FIXME: Need to send() this all at once |
127 send(features); |
128 send("<stream:features>"); |
|
129 |
128 |
130 for _, feature in ipairs(features) do |
129 (session.log or log)("info", "Sent reply <stream:stream> to client"); |
131 send(tostring(feature)); |
|
132 end |
|
133 |
|
134 send("</stream:features>"); |
|
135 log("info", "Stream opened successfully"); |
|
136 session.notopen = nil; |
130 session.notopen = nil; |
137 end |
131 end |
138 |
132 |
139 function send_to_available_resources(user, host, stanza) |
133 function send_to_available_resources(user, host, stanza) |
140 local count = 0; |
134 local count = 0; |