commit 594fdd02aaa482b8273a8d24aa48510ecf0981ba from: Alexander Barton date: Sun Jan 22 21:41:39 2012 UTC 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. commit - 6a308fcb42eae1de168699ed432b49b610073ede commit + 594fdd02aaa482b8273a8d24aa48510ecf0981ba blob - 93c43b75f14072b71aa17ef3843f3fdcee6b8c8a blob + 841e6e62739274a0b862ba4bab1284091605ff07 --- src/ngircd/irc-info.c +++ src/ngircd/irc-info.c @@ -1112,6 +1112,12 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIE if (Client_HasMode(c, 'R') && !IRC_WriteStrClient(from, RPL_WHOISREGNICK_MSG, 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!) */ blob - 340f5f40dc5f3d8aa4ea36f9544bb9dabe2bf2be blob + f05907729ed9150643ec9f56337c1656f63f4e97 --- src/ngircd/messages.h +++ 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"