case 'R':
matchsel |= WHO_FIELD_REN;
continue;
+ case 'a':
+ case 'A':
+ matchsel |= WHO_FIELD_ACC;
+ continue;
}
if (ch == '%')
while ((ch = *p++) && (ch != ','))
case 'U':
fields |= WHO_FIELD_UID;
break;
+ case 'a':
+ case 'A':
+ fields |= WHO_FIELD_ACC;
+ break;
default:
break;
}
for (member = chptr->members; member; member = member->next_member)
{
acptr = member->user;
- if ((bitsel & WHOSELECT_OPER) &&
- !(IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
- HasPriv(sptr, PRIV_SEE_OPERS))))
+ if ((bitsel & WHOSELECT_OPER) && !SeeOper(sptr,acptr))
continue;
- if ((acptr != sptr) && (member->status & CHFL_ZOMBIE))
+ if ((acptr != sptr) && (member->status & (CHFL_ZOMBIE | CHFL_DELAYED)))
continue;
if (!(isthere || (SEE_USER(sptr, acptr, bitsel))))
continue;
else
{
if ((acptr = FindUser(nick)) &&
- ((!(bitsel & WHOSELECT_OPER)) ||
- (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
- HasPriv(sptr, PRIV_SEE_OPERS)))) &&
+ ((!(bitsel & WHOSELECT_OPER)) || SeeOper(sptr,acptr)) &&
Process(acptr) && SHOW_MORE(sptr, counter))
{
do_who(sptr, acptr, 0, fields, qrt);
real mask and try to match all relevant fields */
if (!(commas || (counter < 1)))
{
+ struct irc_in_addr imask;
int minlen, cset;
- static struct in_mask imask;
+ unsigned char ibits;
+
if (mask)
{
matchcomp(mymask, &minlen, &cset, mask);
- if (matchcompIP(&imask, mask))
+ if (!ipmask_parse(mask, &imask, &ibits))
matchsel &= ~WHO_FIELD_NIP;
if ((minlen > NICKLEN) || !(cset & NTL_IRCNK))
matchsel &= ~WHO_FIELD_NIC;
if (!(IsUser(acptr) && Process(acptr)))
continue; /* Now Process() is at the beginning, if we fail
we'll never have to show this acptr in this query */
- if ((bitsel & WHOSELECT_OPER) &&
- !(IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
- HasPriv(sptr, PRIV_SEE_OPERS))))
+ if ((bitsel & WHOSELECT_OPER) && !SeeOper(sptr,acptr))
continue;
if ((mask) &&
((!(matchsel & WHO_FIELD_NIC))
|| matchexec(cli_info(acptr), mymask, minlen))
&& ((!(matchsel & WHO_FIELD_NIP))
|| (HasHiddenHost(acptr) && !IsAnOper(sptr))
- || ((((cli_ip(acptr).s_addr & imask.mask.s_addr) !=
- imask.bits.s_addr)) || (imask.fall
- && matchexec(ircd_ntoa((const char*) &(cli_ip(acptr))), mymask, minlen)))))
+ || !ipmask_check(&cli_ip(acptr), &imask, ibits)))
continue;
if (!SHOW_MORE(sptr, counter))
break;
{
if (!(IsUser(acptr) && Process(acptr)))
continue;
- if ((bitsel & WHOSELECT_OPER) &&
- !(IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
- HasPriv(sptr, PRIV_SEE_OPERS))))
+ if ((bitsel & WHOSELECT_OPER) && !SeeOper(sptr,acptr))
continue;
if (!(SEE_USER(sptr, acptr, bitsel)))
continue;
|| matchexec(cli_info(acptr), mymask, minlen))
&& ((!(matchsel & WHO_FIELD_NIP))
|| (HasHiddenHost(acptr) && !IsAnOper(sptr))
- || ((((cli_ip(acptr).s_addr & imask.mask.s_addr) != imask.bits.s_addr))
- || (imask.fall
- && matchexec(ircd_ntoa((const char*) &(cli_ip(acptr))), mymask, minlen)))))
+ || !ipmask_check(&cli_ip(acptr), &imask, ibits)))
continue;
if (!SHOW_MORE(sptr, counter))
break;