X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_who.c;h=f344e6f2e88587250d73f1e348a1e772c0dfbfb0;hb=1570a04e15bec6b2945e4351b1e05211aecdcacc;hp=35b40939d8ecca9763f32ac91dceabe2723d3ad1;hpb=fc21303989a07d6091ef684150db29c49f682614;p=ircu2.10.12-pk.git diff --git a/ircd/m_who.c b/ircd/m_who.c index 35b4093..f344e6f 100644 --- a/ircd/m_who.c +++ b/ircd/m_who.c @@ -101,8 +101,8 @@ /* - * A little spin-marking utility to tell us wich clients we have already - * processed and wich not + * A little spin-marking utility to tell us which clients we have already + * processed and which not */ static int who_marker = 0; static void move_marker(void) @@ -143,7 +143,7 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) struct Client *acptr; /* Client to show */ int bitsel; /* Mask of selectors to apply */ - int matchsel; /* Wich fields the match should apply on */ + int matchsel; /* Which fields the match should apply on */ int counter; /* Query size counter, initially used to count fields */ int commas; /* Does our mask contain any comma ? @@ -174,6 +174,10 @@ 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; @@ -267,6 +271,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 +330,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 +380,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 +415,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 +453,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 +466,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; }