Module: ngircd.git Branch: master Commit: 594fdd02aaa482b8273a8d24aa48510ecf0981ba URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=594fd...
Author: Alexander Barton alex@barton.de Date: Sun Jan 22 22:41:39 2012 +0100
New RPL_WHOISHOST_MSG(378): show hostname and IP address
The numeric RPL_WHOISHOST_MSG(378) returns the DNS hostname (if available) and the IP address of a client in the WHOIS reply.
Only the user itself and local IRC operators get this numeric.
---
src/ngircd/irc-info.c | 6 ++++++ src/ngircd/messages.h | 1 + 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 93c43b7..841e6e6 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -1114,6 +1114,12 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c) Client_ID(from), Client_ID(c))) return DISCONNECTED;
+ if (Client_Conn(c) > NONE && (Client_OperByMe(from) || from == c) && + !IRC_WriteStrClient(from, RPL_WHOISHOST_MSG, Client_ID(from), + Client_ID(c), Client_Hostname(c), + Conn_GetIPAInfo(Client_Conn(c)))) + return DISCONNECTED; + /* Idle and signon time (local clients only!) */ if (!Conf_MorePrivacy && Client_Conn(c) > NONE && !IRC_WriteStrClient(from, RPL_WHOISIDLE_MSG, diff --git a/src/ngircd/messages.h b/src/ngircd/messages.h index 340f5f4..f059077 100644 --- a/src/ngircd/messages.h +++ b/src/ngircd/messages.h @@ -91,6 +91,7 @@ #define RPL_MOTD_MSG "372 %s :- %s" #define RPL_MOTDSTART_MSG "375 %s :- %s message of the day" #define RPL_ENDOFMOTD_MSG "376 %s :End of MOTD command" +#define RPL_WHOISHOST_MSG "378 %s %s :is connecting from *@%s %s" #define RPL_YOUREOPER_MSG "381 %s :You are now an IRC Operator" #define RPL_YOURESERVICE_MSG "383 %s :You are service %s" #define RPL_TIME_MSG "391 %s %s :%s"