diff --git a/include/numeric.h b/include/numeric.h index 624cc308..8cc27242 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -109,6 +109,8 @@ #define RPL_ENDOFWHOIS 318 #define RPL_WHOISCHANNELS 319 +#define RPL_OPERONLY 320 + #define RPL_LISTSTART 321 #define RPL_LIST 322 #define RPL_LISTEND 323 diff --git a/src/channel.c b/src/channel.c index af687ee4..3ca7b369 100644 --- a/src/channel.c +++ b/src/channel.c @@ -2088,6 +2088,10 @@ static int set_mode(aClient *cptr, aClient *sptr, aChannel *chptr, break; } + /* Let IRCops know if they're getting information not visible to normal users */ + if((chptr->xflags & XFLAG_HIDE_MODE_LISTS) && IsAnOper(sptr)) + sendto_one(sptr, rpl_str(RPL_OPERONLY), me.name, cptr->name, chptr->chname, "+I"); + for (invite = chptr->invite_list; invite; invite = invite->next) sendto_one(sptr, rpl_str(RPL_INVITELIST), me.name, cptr->name, chptr->chname, invite->invstr, invite->who, invite->when); @@ -2170,6 +2174,11 @@ static int set_mode(aClient *cptr, aClient *sptr, aChannel *chptr, anylistsent = 1; break; } + + /* Let IRCops know if they're getting information not visible to normal users */ + if((chptr->xflags & XFLAG_HIDE_MODE_LISTS) && IsAnOper(sptr)) + sendto_one(sptr, rpl_str(RPL_OPERONLY), me.name, cptr->name, chptr->chname, "+e"); + for (exempt = chptr->banexempt_list; exempt; exempt = exempt->next) sendto_one(sptr, rpl_str(RPL_EXEMPTLIST), me.name, cptr->name, chptr->chname, exempt->banstr, exempt->who, exempt->when); @@ -2252,6 +2261,11 @@ static int set_mode(aClient *cptr, aClient *sptr, aChannel *chptr, anylistsent = 1; break; } + + /* Let IRCops know if they're getting information not visible to normal users */ + if((chptr->xflags & XFLAG_HIDE_MODE_LISTS) && IsAnOper(sptr)) + sendto_one(sptr, rpl_str(RPL_OPERONLY), me.name, cptr->name, chptr->chname, "+b"); + for(bp=chptr->banlist;bp;bp=bp->next) sendto_one(sptr, rpl_str(RPL_BANLIST), me.name, cptr->name, chptr->chname, bp->banstr, bp->who, bp->when); diff --git a/src/s_err.c b/src/s_err.c index 4f83f39d..c8f4aa91 100644 --- a/src/s_err.c +++ b/src/s_err.c @@ -349,7 +349,7 @@ static char *replies[] = "signon time", /* 318 RPL_ENDOFWHOIS */ ":%s 318 %s %s :End of /WHOIS list.", /* 319 RPL_WHOISCHANNELS */ ":%s 319 %s %s :%s", - /* 320 */ NULL, + /* 320 RPL_OPERONLY */ ":%s 320 %s %s :Returned %s data is not visible to normal users", /* 321 RPL_LISTSTART */ ":%s 321 %s Channel :Users Name", /* 322 RPL_LIST */ ":%s 322 %s %s %d :%s", /* 323 RPL_LISTEND */ ":%s 323 %s :End of /LIST", @@ -367,7 +367,7 @@ static char *replies[] = /* 335 */ NULL, /* 336 */ NULL, /* 337 RPL_WHOISTEXT*/ ":%s 337 %s %s :%s", - /* 338 RPL_WHOISACTUALLY */ ":%s 338 %s %s :is actually %s@%s [%s]", + /* 338 RPL_WHOISACTUALLY */ ":%s 338 %s %s :is actually %s@%s [%s] [IRCop Restricted Information]", /* 339 */ NULL, /* 340 */ NULL, /* 341 RPL_INVITING */ ":%s 341 %s %s %s", diff --git a/src/s_user.c b/src/s_user.c index f2fd3dba..b7f13b36 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -2204,8 +2204,8 @@ m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[]) if(IsAnOper(sptr) && IsSquelch(acptr)) sendto_one(sptr, rpl_str(RPL_WHOISTEXT), me.name, parv[0], name, - IsWSquelch(acptr) ? "User is squelched (warned)" : - "User is squelched (silent)"); + IsWSquelch(acptr) ? "User is squelched (warned) [IRCop Restricted Information]" : + "User is squelched (silent) [IRCop Restricted Information]"); if(IsRegNick(acptr)) sendto_one(sptr, rpl_str(RPL_WHOISREGNICK), me.name, parv[0], name); @@ -2232,8 +2232,16 @@ m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[]) { servicestag = acptr->user->servicestag; while(servicestag) - { - if(*servicestag->tag && (!servicestag->umode || (sptr->umode & servicestag->umode))) sendto_one(sptr, ":%s %d %s %s :%s", me.name, servicestag->raw, parv[0], name, servicestag->tag); + { + if(*servicestag->tag) + { + /* If servicestag->umode is unset, this is viewable by everybody. */ + if(!servicestag->umode) + sendto_one(sptr, ":%s %d %s %s :%s", me.name, servicestag->raw, parv[0], name, servicestag->tag); + /* Otherwise, it can only be viewed by users with the correct umode (usually +o or higher) */ + else if(sptr->umode & servicestag->umode) + sendto_one(sptr, ":%s %d %s %s :%s [IRCop Restricted Information]", me.name, servicestag->raw, parv[0], name, servicestag->tag); + } servicestag = servicestag->next; } }