Use a stanza for c2s stream features instead of an array of strings. Removes a FIXME.
[prosody.git] / plugins / mod_tls.lua
index b5ca5015fe23162599b5379ccf5d6449827bcac5..cc46d55613187e79c1cf30d4fb7eab1f27848c2c 100644 (file)
@@ -24,9 +24,10 @@ add_handler("c2s_unauthed", "starttls", xmlns_starttls,
                        end
                end);
                
+local starttls_attr = { xmlns = xmlns_starttls };
 add_event_hook("stream-features", 
                                        function (session, features)                                                                                            
                                                if session.conn.starttls then
-                                                       t_insert(features, "<starttls xmlns='"..xmlns_starttls.."'/>");
+                                                       features:tag("starttls", starttls_attr):up();
                                                end
                                        end);