- if (mlen + idx + NICKLEN + 3 > BUFSIZE) /* space, \r\n\0 */
- {
- send_reply(sptr, RPL_NAMREPLY, buf);
- strcpy(buf, "* * :");
- idx = 5;
- flag = 0;
- }
- }
- if (flag)
- send_reply(sptr, RPL_NAMREPLY, buf);
- send_reply(sptr, RPL_ENDOFNAMES, "*");
- return 1;
- }
-
- /*
- * Special Case 2: User is on this channel, requesting full names list.
- * (As performed with each /join) - ** High frequency usage **
- */
-
- clean_channelname(para);
- chptr = FindChannel(para);
-
- if (chptr) {
- member = find_member_link(chptr, sptr);
- if (member)
- {
- do_names(sptr, chptr, NAMES_ALL);
- if (!EmptyString(para))
- {
- send_reply(sptr, RPL_ENDOFNAMES, chptr ? chptr->chname : para);
- return 1;
- }
- }
- else
- {
- /*
- * Special Case 3: User isn't on this channel, show all visible users, in
- * non secret channels.
- */
- do_names(sptr, chptr, NAMES_VIS);
- }
- } else { /* Channel doesn't exist. */
- send_reply(sptr, RPL_ENDOFNAMES, para);
- }
- return 1;
-}