Use a stanza for c2s stream features instead of an array of strings. Removes a FIXME.
[prosody.git] / core / sessionmanager.lua
index 8be7bdec6a1f885d943903c096f5d30a5b71c7a2..e83b7c2334217e8ef28df6562aae9059f3f4abbc 100644 (file)
@@ -121,18 +121,12 @@ function streamopened(session, attr)
                                                end
                                                
                                                
-                                               local features = {};
+                                               local features = st.stanza("stream:features");
                                                modulemanager.fire_event("stream-features", session, features);
                                                
-                                               -- FIXME: Need to send() this all at once
-                                               send("<stream:features>");
+                                               send(features);
                                                
-                                               for _, feature in ipairs(features) do
-                                                       send(tostring(feature));
-                                               end
-                                               send("</stream:features>");
-                                               log("info", "Stream opened successfully");
+                                               (session.log or log)("info", "Sent reply <stream:stream> to client");
                                                session.notopen = nil;
 end