X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..8a1e143f6fb3509ad390554e2c49af723794cd96:/modules/m_whois.c diff --git a/modules/m_whois.c b/modules/m_whois.c index ef60a55..9d9490a 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_whois.c 1879 2006-08-27 21:18:43Z jilles $ + * $Id: m_whois.c 3299 2007-03-28 14:54:10Z jilles $ */ #include "stdinc.h" @@ -67,7 +67,7 @@ mapi_hlist_av1 whois_hlist[] = { { NULL, NULL } }; -DECLARE_MODULE_AV1(whois, NULL, NULL, whois_clist, whois_hlist, NULL, "$Revision: 1879 $"); +DECLARE_MODULE_AV1(whois, NULL, NULL, whois_clist, whois_hlist, NULL, "$Revision: 3299 $"); /* * m_whois @@ -210,7 +210,7 @@ do_whois(struct Client *client_p, struct Client *source_p, int parc, const char else sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), - IsDigit(*nick) ? "*" : nick); + nick); sendto_one_numeric(source_p, RPL_ENDOFWHOIS, form_str(RPL_ENDOFWHOIS), parv[1]); @@ -280,28 +280,31 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) t = buf + mlen; - DLINK_FOREACH(ptr, target_p->user->channel.head) + if (!IsService(target_p)) { - msptr = ptr->data; - chptr = msptr->chptr; + DLINK_FOREACH(ptr, target_p->user->channel.head) + { + msptr = ptr->data; + chptr = msptr->chptr; - visible = IsService(target_p) ? IsMember(source_p, chptr) : ShowChannel(source_p, chptr); + visible = ShowChannel(source_p, chptr); - if(visible || operspy) - { - if((cur_len + strlen(chptr->chname) + 3) > (BUFSIZE - 5)) + if(visible || operspy) { - sendto_one(source_p, "%s", buf); - cur_len = mlen + extra_space; - t = buf + mlen; + if((cur_len + strlen(chptr->chname) + 3) > (BUFSIZE - 5)) + { + sendto_one(source_p, "%s", buf); + cur_len = mlen + extra_space; + t = buf + mlen; + } + + tlen = ircsprintf(t, "%s%s%s ", + visible ? "" : "!", + find_channel_status(msptr, 1), + chptr->chname); + t += tlen; + cur_len += tlen; } - - tlen = ircsprintf(t, "%s%s%s ", - visible ? "" : "!", - find_channel_status(msptr, 1), - chptr->chname); - t += tlen; - cur_len += tlen; } }