int flag;
int len;
int mlen;
+ int needs_space;
char* s;
char* para = parc > 1 ? parv[1] : 0;
char buf[BUFSIZE];
- if (parc > 2 && hunt_server(1, cptr, sptr, "%s%s " TOK_NAMES " %s %s", 2, parc, parv))
+ if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc,
+ parv))
return 0;
mlen = strlen(me.name) + 10 + strlen(sptr->name);
*buf = '@';
idx = len + 4;
flag = 1;
+ needs_space = 0;
for (member = chptr->members; member; member = member->next_member)
{
c2ptr = member->user;
-#ifndef GODMODE
- if (sptr != c2ptr && IsInvisible(c2ptr) && !find_channel_member(sptr, chptr))
- continue;
-#endif
+ if (needs_space) {
+ strcat(buf, " ");
+ idx++;
+ }
+ needs_space=1;
if (IsZombie(member))
{
if (member->user != sptr)
idx++;
}
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;
- }
- if (mlen + idx + NICKLEN + 11 > BUFSIZE)
-#else
if (mlen + idx + NICKLEN + 5 > BUFSIZE)
-#endif
/* space, modifier, nick, \r \n \0 */
{
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ send_reply(sptr, RPL_NAMREPLY, buf);
strcpy(buf, "* ");
ircd_strncpy(buf + 2, chptr->chname, len + 1);
buf[len + 2] = 0;
*buf = '@';
idx = len + 4;
flag = 0;
+ needs_space=0;
}
}
if (flag)
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ send_reply(sptr, RPL_NAMREPLY, buf);
}
if (!EmptyString(para))
{
- sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0],
- ch2ptr ? ch2ptr->chname : para);
+ send_reply(sptr, RPL_ENDOFNAMES, ch2ptr ? ch2ptr->chname : para);
return (1);
}
if (mlen + idx + NICKLEN + 3 > BUFSIZE) /* space, \r\n\0 */
#endif
{
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ send_reply(sptr, RPL_NAMREPLY, buf);
strcpy(buf, "* * :");
idx = 5;
flag = 0;
}
}
if (flag)
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
- sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0], "*");
+ send_reply(sptr, RPL_NAMREPLY, buf);
+ send_reply(sptr, RPL_ENDOFNAMES, "*");
return 1;
return 0;
}
char *s, *para = parc > 1 ? parv[1] : 0;
char buf[BUFSIZE];
- if (parc > 2 && hunt_server(1, cptr, sptr, "%s%s " TOK_NAMES " %s %s", 2, parc, parv))
+ if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc,
+ parv))
return 0;
mlen = strlen(me.name) + 10 + strlen(sptr->name);
#endif
/* space, modifier, nick, \r \n \0 */
{
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ send_reply(sptr, RPL_NAMREPLY, buf);
strcpy(buf, "* ");
ircd_strncpy(buf + 2, chptr->chname, len + 1);
buf[len + 2] = 0;
}
}
if (flag)
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ send_reply(sptr, RPL_NAMREPLY, buf);
}
if (!EmptyString(para))
{
- sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0],
- ch2ptr ? ch2ptr->chname : para);
+ send_reply(sptr, RPL_ENDOFNAMES, ch2ptr ? ch2ptr->chname : para);
return (1);
}
if (mlen + idx + NICKLEN + 3 > BUFSIZE) /* space, \r\n\0 */
#endif
{
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ send_reply(sptr, RPL_NAMREPLY, buf);
strcpy(buf, "* * :");
idx = 5;
flag = 0;
}
}
if (flag)
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
- sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0], "*");
+ send_reply(sptr, RPL_NAMREPLY, buf);
+ send_reply(sptr, RPL_ENDOFNAMES, "*");
return 1;
return 0;
}
char *s, *para = parc > 1 ? parv[1] : 0;
char buf[BUFSIZE];
- if (parc > 2 && hunt_server(1, cptr, sptr, "%s%s " TOK_NAMES " %s %s", 2, parc, parv))
+ if (parc > 2 && hunt_server(1, cptr, sptr, "%s%s " TOK_NAMES " %s %s", 2, parc, parv)) /* XXX DEAD */
return 0;
mlen = strlen(me.name) + 10 + strlen(sptr->name);
#endif
/* space, modifier, nick, \r \n \0 */
{
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf); /* XXX DEAD */
strcpy(buf, "* ");
ircd_strncpy(buf + 2, chptr->chname, len + 1);
buf[len + 2] = 0;
}
}
if (flag)
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf); /* XXX DEAD */
}
if (!EmptyString(para))
{
- sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0],
+ sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0], /* XXX DEAD */
ch2ptr ? ch2ptr->chname : para);
return (1);
}
if (mlen + idx + NICKLEN + 3 > BUFSIZE) /* space, \r\n\0 */
#endif
{
- sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf);
+ 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);
- sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0], "*");
+ 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 */
return 1;
}
#endif /* 0 */