mod_console: s2s:show(): Indicate when a connection is encrypted

Mon, 05 Oct 2009 15:16:34 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 05 Oct 2009 15:16:34 +0100
changeset 1914
e7f6baf39b56
parent 1913
da49a59dff7c
child 1916
7f8928aa0b9d

mod_console: s2s:show(): Indicate when a connection is encrypted

plugins/mod_console.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_console.lua	Mon Oct 05 15:00:05 2009 +0100
+++ b/plugins/mod_console.lua	Mon Oct 05 15:16:34 2009 +0100
@@ -467,7 +467,7 @@
 		for remotehost, session in pairs(host_session.s2sout) do
 			if (not match_jid) or remotehost:match(match_jid) or host:match(match_jid) then
 				count_out = count_out + 1;
-				print("    "..host.." -> "..remotehost);
+				print("    "..host.." -> "..remotehost..(session.secure and "(encrypted)" or ""));
 				if session.sendq then
 					print("        There are "..#session.sendq.." queued outgoing stanzas for this connection");
 				end
@@ -500,7 +500,7 @@
 			if session.to_host == host and ((not match_jid) or host:match(match_jid) 
 				or (session.from_host and session.from_host:match(match_jid))) then
 				count_in = count_in + 1;
-				print("    "..host.." <- "..(session.from_host or "(unknown)"));
+				print("    "..host.." <- "..(session.from_host or "(unknown)")..(session.secure and "(encrypted)" or ""));
 				if session.type == "s2sin_unauthed" then
 						print("        Connection not yet authenticated");
 				end

mercurial