# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1273616220 -3600
# Node ID 4f13cc5f96b0b577b14e94cee04b1d785a3b7a45
# Parent  a28540d4117a10859a2eead5c56670794a8f8d9b
verse.plugins.tls: Set secure flag, hide some warnings

diff -r a28540d4117a -r 4f13cc5f96b0 plugins/tls.lua
--- a/plugins/tls.lua	Tue May 11 23:09:37 2010 +0100
+++ b/plugins/tls.lua	Tue May 11 23:17:00 2010 +0100
@@ -8,9 +8,9 @@
 			stream:debug("Negotiating TLS...");
 			stream:send(st.stanza("starttls", { xmlns = xmlns_tls }));
 			return true;
-		elseif not stream.conn.starttls then
+		elseif not stream.conn.starttls and not self.secure then
 			stream:warn("SSL libary (LuaSec) not loaded, so TLS not available");
-		else
+		elseif not self.secure then
 			stream:debug("Server doesn't offer TLS :(");
 		end
 	end
@@ -22,6 +22,7 @@
 	end
 	local function handle_status(new_status)
 		if new_status == "ssl-handshake-complete" then
+			self.secure = true;
 			stream:debug("Re-opening stream...");
 			stream:reopen();
 		end