X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_who.c;h=49df47580c393399ab9e97ae91a50dced6cc19a6;hb=refs%2Fheads%2Fupstream-ssl;hp=d2a4411ab6b7494a7bbafb5579e98100f48d51de;hpb=b95f40f9ed63623ca230165e95cdc77ae6d1e2a6;p=ircu2.10.12-pk.git diff --git a/ircd/m_who.c b/ircd/m_who.c index d2a4411..49df475 100644 --- a/ircd/m_who.c +++ b/ircd/m_who.c @@ -174,16 +174,21 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) while (((ch = *(p++))) && (ch != '%') && (ch != ',')) switch (ch) { + case 'd': + case 'D': + bitsel |= WHOSELECT_DELAY; + continue; case 'o': case 'O': bitsel |= WHOSELECT_OPER; continue; case 'x': case 'X': - bitsel |= WHOSELECT_EXTRA; - if (HasPriv(sptr, PRIV_WHOX)) - log_write(LS_WHO, L_INFO, LOG_NOSNOTICE, "%#C WHO %s %s", sptr, - (BadPtr(parv[3]) ? parv[1] : parv[3]), parv[2]); + if (HasPriv(sptr, PRIV_WHOX) && IsAnOper(sptr)) { + bitsel |= WHOSELECT_EXTRA; + log_write(LS_WHO, L_INFO, LOG_NOSNOTICE, "%#C WHO %s %s", sptr, + (BadPtr(parv[3]) ? parv[1] : parv[3]), parv[2]); + } continue; case 'n': case 'N': @@ -267,6 +272,10 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) case 'A': fields |= WHO_FIELD_ACC; break; + case 'o': + case 'O': + fields |= WHO_FIELD_OPL; + break; default: break; } @@ -322,7 +331,10 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) acptr = member->user; if ((bitsel & WHOSELECT_OPER) && !SeeOper(sptr,acptr)) continue; - if ((acptr != sptr) && (member->status & (CHFL_ZOMBIE | CHFL_DELAYED))) + if ((acptr != sptr) + && ((member->status & CHFL_ZOMBIE) + || ((member->status & CHFL_DELAYED) + && !(bitsel & WHOSELECT_DELAY)))) continue; if (!(isthere || (SEE_USER(sptr, acptr, bitsel)))) continue; @@ -369,6 +381,8 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) matchsel &= ~WHO_FIELD_UID; if ((minlen > HOSTLEN) || !(cset & NTL_IRCHN)) matchsel &= ~WHO_FIELD_HOS; + if ((minlen > ACCOUNTLEN)) + matchsel &= ~WHO_FIELD_ACC; } /* First of all loop through the clients in common channels */ @@ -402,7 +416,9 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) || matchexec(cli_info(acptr), mymask, minlen)) && ((!(matchsel & WHO_FIELD_NIP)) || (HasHiddenHost(acptr) && !IsAnOper(sptr)) - || !ipmask_check(&cli_ip(acptr), &imask, ibits))) + || !ipmask_check(&cli_ip(acptr), &imask, ibits)) + && ((!(matchsel & WHO_FIELD_ACC)) + || matchexec(cli_user(acptr)->account, mymask, minlen))) continue; if (!SHOW_MORE(sptr, counter)) break; @@ -438,7 +454,9 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) || matchexec(cli_info(acptr), mymask, minlen)) && ((!(matchsel & WHO_FIELD_NIP)) || (HasHiddenHost(acptr) && !IsAnOper(sptr)) - || !ipmask_check(&cli_ip(acptr), &imask, ibits))) + || !ipmask_check(&cli_ip(acptr), &imask, ibits)) + && ((!(matchsel & WHO_FIELD_ACC)) + || matchexec(cli_user(acptr)->account, mymask, minlen))) continue; if (!SHOW_MORE(sptr, counter)) break; @@ -449,11 +467,10 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) /* Make a clean mask suitable to be sent in the "end of" */ if (mask && (p = strchr(mask, ' '))) *p = '\0'; - send_reply(sptr, RPL_ENDOFWHO, BadPtr(mask) ? "*" : mask); - /* Notify the user if we decided that his query was too long */ if (counter < 0) - send_reply(sptr, ERR_QUERYTOOLONG, "WHO"); + send_reply(sptr, ERR_QUERYTOOLONG, BadPtr(mask) ? "*" : mask); + send_reply(sptr, RPL_ENDOFWHO, BadPtr(mask) ? "*" : mask); return 0; }