1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-10-28 04:46:17 +00:00

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.
This commit is contained in:
DNS777 2012-10-06 21:56:59 +02:00 committed by Alexander Barton
parent de453d71cb
commit 56cdc2175c
2 changed files with 7 additions and 0 deletions

View File

@ -1156,6 +1156,12 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
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) &&
!IRC_WriteStrClient(from, RPL_WHOISHOST_MSG, Client_ID(from),
Client_ID(c), Client_Hostname(c),

View File

@ -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"