- strcpy(buf, "* * :");
- idx = 5;
- flag = 0;
- for (c2ptr = GlobalClientList; c2ptr; c2ptr = c2ptr->next)
- {
- struct Channel *ch3ptr;
- int showflag = 0, secret = 0;
-
-#ifndef GODMODE
- if (!IsUser(c2ptr) || (sptr != c2ptr && IsInvisible(c2ptr)))
-#else
- if (!IsUser(c2ptr))
-#endif
- continue;
- member = c2ptr->user->channel;
- /*
- * Don't show a client if they are on a secret channel or when
- * they are on a channel sptr is on since they have already
- * been show earlier. -avalon
- */
- while (member)
- {
- ch3ptr = member->channel;
-#ifndef GODMODE
- if (PubChannel(ch3ptr) || find_channel_member(sptr, ch3ptr))
-#endif
- showflag = 1;
- if (SecretChannel(ch3ptr))
- secret = 1;
- member = member->next_channel;
- }
- if (showflag) /* Have we already shown them ? */
- continue;
-#ifndef GODMODE
- if (secret) /* On any secret channels ? */
- continue;
-#endif
- strcat(buf, c2ptr->name);
- strcat(buf, " ");
- idx += strlen(c2ptr->name) + 1;
- flag = 1;
-#ifdef GODMODE
- {
- char yxx[6];
- sprintf_irc(yxx, "%s%s", NumNick(c2ptr));
- assert(c2ptr == findNUser(yxx));
- sprintf_irc(buf + strlen(buf), "(%s) ", yxx);
- idx += 6;
- }
-#endif
-#ifdef GODMODE
- if (mlen + idx + NICKLEN + 9 > BUFSIZE)
-#else
- if (mlen + idx + NICKLEN + 3 > BUFSIZE) /* space, \r\n\0 */
-#endif
- {
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf); /* XXX DEAD */
- strcpy(buf, "* * :");
- idx = 5;
- flag = 0;
- }
- }
- if (flag)
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf); /* XXX DEAD */
- sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0], "*"); /* XXX DEAD */