show_capabilities cleanup and now show whether we are TS or TS6 and SSL link

This commit is contained in:
Valery Yatsko 2008-04-07 20:21:09 +04:00
parent bbe968ca0c
commit f4a759c560

View file

@ -838,32 +838,25 @@ show_capabilities(struct Client *target_p)
{
static char msgbuf[BUFSIZE];
struct Capability *cap;
char *t;
int tl;
t = msgbuf;
tl = rb_sprintf(msgbuf, "TS ");
t += tl;
if(has_id(target_p))
rb_strlcpy(msgbuf, " TS6", sizeof(msgbuf));
else
rb_strlcpy(msgbuf, " TS", sizeof(msgbuf));
if(IsSSL(target_p))
rb_strlcat(msgbuf, " SSL", sizeof(msgbuf));
if(!IsServer(target_p) || !target_p->serv->caps) /* short circuit if no caps */
{
msgbuf[2] = '\0';
return msgbuf;
}
return msgbuf + 1;
for (cap = captab; cap->cap; ++cap)
{
if(cap->cap & target_p->serv->caps)
{
tl = rb_sprintf(t, "%s ", cap->name);
t += tl;
}
rb_snprintf_append(msgbuf, sizeof(msgbuf), " %s", cap->name);
}
t--;
*t = '\0';
return msgbuf;
return msgbuf + 1;
}
/*