X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_ison.c;h=00adddc84f104d3133807076fa593a875b2a0eb1;hb=refs%2Fheads%2Fupstream-ssl;hp=2b6852bfd60d8920eae05947250bcdb2a0da05b0;hpb=42018a0638a44a4a91ff78b56b852a881c828846;p=ircu2.10.12-pk.git diff --git a/ircd/m_ison.c b/ircd/m_ison.c index 2b6852b..00adddc 100644 --- a/ircd/m_ison.c +++ b/ircd/m_ison.c @@ -79,30 +79,25 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ -#if 0 -/* - * No need to include handlers.h here the signatures must match - * and we don't need to force a rebuild of all the handlers everytime - * we add a new one to the list. --Bleep - */ -#include "handlers.h" -#endif /* 0 */ +#include "config.h" + #include "client.h" #include "hash.h" #include "ircd.h" +#include "ircd_log.h" #include "ircd_reply.h" #include "ircd_string.h" #include "msgq.h" #include "numeric.h" #include "send.h" -#include +/* #include -- Now using assert in ircd_log.h */ #include /* * m_ison * - * Added by Darren Reed 13/8/91 to act as an efficent user indicator + * Added by Darren Reed 13/8/91 to act as an efficient user indicator * with respect to cpu/bandwidth used. Implemented for NOTIFY feature in * clients. Designed to reduce number of whois requests. Can process * nicknames in batches as long as the maximum buffer length. @@ -120,21 +115,25 @@ int m_ison(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) char* name; char* p = 0; struct MsgBuf* mb; + int i; if (parc < 2) return need_more_params(sptr, "ISON"); - mb = msgq_make(sptr, rpl_str(RPL_ISON), me.name, sptr->name); + mb = msgq_make(sptr, rpl_str(RPL_ISON), cli_name(&me), cli_name(sptr)); - for (name = ircd_strtok(&p, parv[1], " "); name; - name = ircd_strtok(&p, 0, " ")) { - if ((acptr = FindUser(name))) { - if (msgq_bufleft(mb) < strlen(acptr->name) + 1) { - send_buffer(sptr, mb, 0); /* send partial response */ - msgq_clean(mb); /* then do another round */ - mb = msgq_make(sptr, rpl_str(RPL_ISON), me.name, sptr->name); + for (i = 1; i < parc; i++) { + for (name = ircd_strtok(&p, parv[i], " "); name; + name = ircd_strtok(&p, 0, " ")) { + if ((acptr = FindUser(name))) { + if (msgq_bufleft(mb) < strlen(cli_name(acptr)) + 1) { + send_buffer(sptr, mb, 0); /* send partial response */ + msgq_clean(mb); /* then do another round */ + mb = msgq_make(sptr, rpl_str(RPL_ISON), cli_name(&me), + cli_name(sptr)); + } + msgq_append(0, mb, "%s ", cli_name(acptr)); } - msgq_append(0, mb, "%s ", acptr->name); /* append nickname */ } } @@ -143,5 +142,3 @@ int m_ison(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) return 0; } - -