Make the target user's modes show up in whois.
This commit is contained in:
parent
074fe45ad7
commit
88b63e6506
|
@ -204,6 +204,8 @@ extern const char *form_str(int);
|
|||
#define RPL_ENDOFMOTD 376
|
||||
#define RPL_WHOISHOST 378
|
||||
|
||||
#define RPL_WHOISMODES 379
|
||||
|
||||
#define RPL_YOUREOPER 381
|
||||
#define RPL_REHASHING 382
|
||||
#define RPL_MYPORTIS 384
|
||||
|
|
|
@ -239,6 +239,8 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
|||
hook_data_client hdata;
|
||||
int visible;
|
||||
int extra_space = 0;
|
||||
int i;
|
||||
char *m;
|
||||
|
||||
if(target_p->user == NULL)
|
||||
{
|
||||
|
@ -330,7 +332,19 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
|||
sendto_one_numeric(source_p, RPL_WHOISBOT,
|
||||
form_str(RPL_WHOISBOT),
|
||||
target_p->name);
|
||||
|
||||
|
||||
m = buf;
|
||||
*m++ = '+';
|
||||
|
||||
for (i = 0; i < 128; i++) /* >= 127 is extended ascii */
|
||||
if (target_p->umodes & user_modes[i])
|
||||
*m++ = (char) i;
|
||||
*m = '\0';
|
||||
|
||||
sendto_one_numeric(source_p, RPL_WHOISMODES,
|
||||
form_str(RPL_WHOISMODES),
|
||||
target_p->name, buf);
|
||||
|
||||
if(MyClient(target_p))
|
||||
{
|
||||
if (IsDynSpoof(target_p) && (IsOper(source_p) || source_p == target_p))
|
||||
|
|
|
@ -400,7 +400,7 @@ static const char * replies[] = {
|
|||
/* 376 RPL_ENDOFMOTD, */ ":%s 376 %s :End of /MOTD command.",
|
||||
/* 377 */ NULL,
|
||||
/* 378 RPL_WHOISHOST, */ "%s :is connecting from *@%s %s",
|
||||
/* 379 */ NULL,
|
||||
/* 379 RPL_WHOISMODES */ "%s :%s,
|
||||
/* 380 */ NULL,
|
||||
/* 381 RPL_YOUREOPER, */ ":%s 381 %s :You're a <censored> <censored> IRC operator! Did you know that? This message is FACTUAL.",
|
||||
/* 382 RPL_REHASHING, */ ":%s 382 %s %s :Rehashing",
|
||||
|
|
Loading…
Reference in New Issue