diff --git a/src/m_rwho.c b/src/m_rwho.c index 0c695ef6..83674156 100644 --- a/src/m_rwho.c +++ b/src/m_rwho.c @@ -1130,11 +1130,17 @@ static void rwho_reply(aClient *cptr, aClient *ac, char *buf, chanMember *cm) if (IsAnOper(ac)) *dst++ = '*'; else if (IsInvisible(ac)) - *dst++ = '%'; + *dst++ = 'I'; + else + *dst++ = 'V'; if (cm) { if (cm->flags & CHFL_CHANOP) *dst++ = '@'; +#ifdef USE_HALFOPS + else if (cm->flags & CHFL_HALFOP) + *dst++ = '%'; +#endif else if (cm->flags & CHFL_VOICE) *dst++ = '+'; } @@ -1227,8 +1233,10 @@ static void rwho_reply(aClient *cptr, aClient *ac, char *buf, chanMember *cm) *dst++ = 'H'; if (IsAnOper(ac)) *dst++ = '*'; - if (IsInvisible(ac)) - *dst++ = '%'; + else if (IsInvisible(ac)) + *dst++ = 'I'; + else + *dst++ = 'V'; if (!cm && (rwho_opts.rplfields & RWO_CHANNEL) && chptr) { @@ -1241,7 +1249,11 @@ static void rwho_reply(aClient *cptr, aClient *ac, char *buf, chanMember *cm) { if (cm->flags & CHFL_CHANOP) *dst++ = '@'; - if (cm->flags & CHFL_VOICE) +#ifdef USE_HALFOPS + else if (cm->flags & CHFL_HALFOP) + *dst++ = '%'; +#endif + else if (cm->flags & CHFL_VOICE) *dst++ = '+'; } } diff --git a/src/m_who.c b/src/m_who.c index 53d1c007..021f545b 100644 --- a/src/m_who.c +++ b/src/m_who.c @@ -254,23 +254,43 @@ int build_searchopts(aClient *sptr, int parc, char *parv[]) sptr->name, "WHO", "who"); return 0; } - if(*parv[args] == '@' || *parv[args] == '+') - { - char *cname = parv[args] + 1; - if(*parv[args] == '@') - { - wsopts.channelflags = CHFL_CHANOP; - if(*cname == '+') +#ifdef USE_HALFOPS + if (*parv[args] == '@' || *parv[args] == '%' || *parv[args] == '+') +#else + if (*parv[args] == '@' || parv[args] == '+') +#endif + { + char *cname = parv[args]; + +#ifdef USE_HALFOPS + while (*cname == '@' || *cname == '%' || *cname == '+') +#else + while (*cname == '@' || *cname == '+') +#endif { - wsopts.channelflags |= CHFL_VOICE; - cname++; + if (wsopts.channelflags) + { + if (*cname == '@') wsopts.channelflags |= CHFL_CHANOP; +#ifdef USE_HALFOPS + else if (*cname == '%') wsopts.channelflags |= CHFL_HALFOP; +#endif + else if (*cname == '+') wsopts.channelflags |= CHFL_VOICE; + } + + else + { + if (*cname == '@') wsopts.channelflags = CHFL_CHANOP; +#ifdef USE_HALFOPS + else if (*cname == '%') wsopts.channelflags = CHFL_HALFOP; +#endif + else if (*cname == '+') wsopts.channelflags = CHFL_VOICE + } + + cname++; } - } - else - wsopts.channelflags = CHFL_VOICE; - - wsopts.channel=find_channel(cname, NullChn); + + wsopts.channel=find_channel(cname, NullChn); } else { @@ -799,11 +819,14 @@ int m_who(aClient *cptr, aClient *sptr, int parc, char *parv[]) /* wow, they passed it all, give them the reply... * IF they haven't reached the max, or they're an oper */ status[i++]=(ac->user->away==NULL ? 'H' : 'G'); - status[i]=(IsAnOper(ac) ? '*' : ((IsInvisible(ac) && - IsOper(sptr)) ? '%' : 0)); - status[((status[i]) ? ++i : i)]=((cm->flags&CHFL_CHANOP) ? '@' - : ((cm->flags&CHFL_VOICE) ? - '+' : 0)); + status[i]=(IsAnOper(ac) ? '*' : + ((IsInvisible(ac) && IsOper(sptr)) ? 'I' : + (!IsInvisible(ac) && IsOper(sptr)) ? 'V' : 0)); + status[((status[i]) ? ++i : i)]=(cm->flags&CHFL_CHANOP) ? '@' : +#ifdef USE_HALFOPS + (cm->flags&CHFL_HALFOP) ? '%' : +#endif + (cm->flags&CHFL_VOICE) ? '+' : 0; status[++i]=0; sendto_one(sptr, getreply(RPL_WHOREPLY), me.name, sptr->name, wsopts.channel->chname, ac->user->username, @@ -832,8 +855,9 @@ int m_who(aClient *cptr, aClient *sptr, int parc, char *parv[]) else { status[0]=(ac->user->away==NULL ? 'H' : 'G'); - status[1]=(IsAnOper(ac) ? '*' : (IsInvisible(ac) && - IsAnOper(sptr) ? '%' : 0)); + status[1]=(IsAnOper(ac) ? '*' : + ((IsInvisible(ac) && IsAnOper(sptr)) ? 'I' : + (!IsInvisible(ac) && IsAnOper(sptr)) ? 'V' : 0)); status[2]=0; sendto_one(sptr, getreply(RPL_WHOREPLY), me.name, sptr->name, wsopts.show_chan ? first_visible_channel(ac, sptr) @@ -870,11 +894,14 @@ int m_who(aClient *cptr, aClient *sptr, int parc, char *parv[]) i = 0; status[i++]=(ac->user->away==NULL ? 'H' : 'G'); - status[i]=(IsAnOper(ac) ? '*' : ((IsInvisible(ac) && - IsOper(sptr)) ? '%' : 0)); - status[((status[i]) ? ++i : i)]=((cm->flags&CHFL_CHANOP) ? - '@' : ((cm->flags&CHFL_VOICE) - ? '+' : 0)); + status[i]=(IsAnOper(ac) ? '*' : + ((IsInvisible(ac) && IsOper(sptr)) ? 'I' : + (!IsInvisible(ac) && IsOper(sptr)) ? 'V' : 0)); + status[((status[i]) ? ++i : i)]=(cm->flags&CHFL_CHANOP) ? '@' : +#ifdef USE_HALFOPS + (cm->flags&CHFL_HALFOP) ? '%' : +#endif + (cm->flags&CHFL_VOICE) ? '+' : 0; status[++i]=0; sendto_one(sptr, getreply(RPL_WHOREPLY), me.name, sptr->name, lp->value.chptr->chname, ac->user->username, @@ -899,8 +926,9 @@ int m_who(aClient *cptr, aClient *sptr, int parc, char *parv[]) break; /* break out of loop so we can send end of who */ } status[0]=(ac->user->away==NULL ? 'H' : 'G'); - status[1]=(IsAnOper(ac) ? '*' : (IsInvisible(ac) && - IsAnOper(sptr) ? '%' : 0)); + status[1]=(IsAnOper(ac) ? '*' : + ((IsInvisible(ac) && IsAnOper(sptr)) ? 'I' : + (!IsInvisible(ac) && IsAnOper(sptr)) ? 'V' : 0)); status[2]=0; sendto_one(sptr, getreply(RPL_WHOREPLY), me.name, sptr->name, wsopts.show_chan ? first_visible_channel(ac, sptr) :