commit 56cdc2175c4cbe6abdf45f2d32016c260f3728f7 from: DNS777 via: Alexander Barton date: Sat Oct 06 19:56:59 2012 UTC Show active user modes in WHOIS reply Implement numeric RPL_WHOISMODES_MSG(379) and show user modes in the reply of the WHOIS command for the user himself or, if MorePrivacy isn't set, for request initiated by an IRC operator. Numeric 379 is used by Unreal and InspIRCd for this purpose, too. Closes bug #129. commit - de453d71cb1bcd78b365f16e994003e913a03148 commit + 56cdc2175c4cbe6abdf45f2d32016c260f3728f7 blob - 4909a96a063a3a9940be0e52d9b9e070925a28c9 blob + 89defc3829ffaf4bba4e05cbcb25377e87ec7a22 --- src/ngircd/irc-info.c +++ src/ngircd/irc-info.c @@ -1154,6 +1154,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 && + (from == c || (!Conf_MorePrivacy && Client_HasMode(from, 'o'))) && + !IRC_WriteStrClient(from, RPL_WHOISMODES_MSG, Client_ID(from), + Client_ID(c), Client_Modes(c))) return DISCONNECTED; if (Client_Conn(c) > NONE && (Client_OperByMe(from) || from == c) && blob - 5c83c5cc7b4c77ee51139b0c6c2c7237d91c4ca1 blob + ac75daf9f09cc5d625c44702c592ea22f29fd6e8 --- src/ngircd/messages.h +++ src/ngircd/messages.h @@ -92,6 +92,7 @@ #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_WHOISMODES_MSG "379 %s %s :is using modes +%s" #define RPL_YOUREOPER_MSG "381 %s :You are now an IRC Operator" #define RPL_REHASHING_MSG "382 %s :Rehashing" #define RPL_YOURESERVICE_MSG "383 %s :You are service %s"