summary refs log tree commit diff
diff options
context:
space:
mode:
authorNeale Pickett <neale@woozle.org>2010-06-11 17:32:41 -0500
committerAlexander Barton <alex@barton.de>2010-06-23 11:00:09 +0200
commit28f8b501744a3c24cd7f5eec44707d656cc987c7 (patch)
treea0ab9c167deb6d0413092e6ba14ffac1fae4bc26
parente2930f3f5e7356d24f4b5e1616cb7674bd0123ec (diff)
downloadngircd-28f8b501744a3c24cd7f5eec44707d656cc987c7.tar.gz
ngircd-28f8b501744a3c24cd7f5eec44707d656cc987c7.zip
Show SSL status in WHOIS, numeric 275
"I've been wanting this for years and finally took the 5 minutes to
patch it in. I took the response code (275) from whatever's running
OFTC's IRC network."
  -- Neale Pickett <neale@woozle.org>, Fri, 11 Jun 2010 17:32:41 -0500

(OFTC is running Hybrid ircd.)
-rw-r--r--src/ngircd/irc-info.c7
-rw-r--r--src/ngircd/messages.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c
index 7d7bb884..7e0bf63c 100644
--- a/src/ngircd/irc-info.c
+++ b/src/ngircd/irc-info.c
@@ -993,6 +993,13 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
 		if( ! IRC_WriteStrClient( from, RPL_WHOISOPERATOR_MSG, Client_ID( from ), Client_ID( c ))) return DISCONNECTED;
 	}
 
+	/* Connected using SSL? */
+	if (Conn_UsesSSL(Client_Conn(c))) {
+		if (!IRC_WriteStrClient
+		    (from, RPL_WHOISSSL_MSG, Client_ID(from), Client_ID(c)))
+			return DISCONNECTED;
+	}
+
 	/* Idle and signon time (local clients only!) */
 	if (Client_Conn(c) > NONE ) {
 		if (! IRC_WriteStrClient(from, RPL_WHOISIDLE_MSG,
diff --git a/src/ngircd/messages.h b/src/ngircd/messages.h
index c356e423..03ddc363 100644
--- a/src/ngircd/messages.h
+++ b/src/ngircd/messages.h
@@ -47,6 +47,7 @@
 #define RPL_LOCALUSERS_MSG		"265 %s %lu %lu :Current local users: %lu, Max: %lu"
 #define RPL_NETUSERS_MSG		"266 %s %lu %lu :Current global users: %lu, Max: %lu"
 #define RPL_STATSCONN_MSG		"250 %s :Highest connection count: %lu (%lu connections received)"
+#define RPL_WHOISSSL_MSG		"275 %s %s :is connected via SSL (secure link)"
 
 #define RPL_AWAY_MSG			"301 %s %s :%s"
 #define RPL_USERHOST_MSG		"302 %s :"