show_capabilities cleanup and now show whether we are TS or TS6 and SSL link
This commit is contained in:
parent
bbe968ca0c
commit
f4a759c560
1 changed files with 64 additions and 71 deletions
27
src/s_serv.c
27
src/s_serv.c
|
@ -838,32 +838,25 @@ show_capabilities(struct Client *target_p)
|
||||||
{
|
{
|
||||||
static char msgbuf[BUFSIZE];
|
static char msgbuf[BUFSIZE];
|
||||||
struct Capability *cap;
|
struct Capability *cap;
|
||||||
char *t;
|
|
||||||
int tl;
|
|
||||||
|
|
||||||
t = msgbuf;
|
if(has_id(target_p))
|
||||||
tl = rb_sprintf(msgbuf, "TS ");
|
rb_strlcpy(msgbuf, " TS6", sizeof(msgbuf));
|
||||||
t += tl;
|
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 */
|
if(!IsServer(target_p) || !target_p->serv->caps) /* short circuit if no caps */
|
||||||
{
|
return msgbuf + 1;
|
||||||
msgbuf[2] = '\0';
|
|
||||||
return msgbuf;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (cap = captab; cap->cap; ++cap)
|
for (cap = captab; cap->cap; ++cap)
|
||||||
{
|
{
|
||||||
if(cap->cap & target_p->serv->caps)
|
if(cap->cap & target_p->serv->caps)
|
||||||
{
|
rb_snprintf_append(msgbuf, sizeof(msgbuf), " %s", cap->name);
|
||||||
tl = rb_sprintf(t, "%s ", cap->name);
|
|
||||||
t += tl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
t--;
|
return msgbuf + 1;
|
||||||
*t = '\0';
|
|
||||||
|
|
||||||
return msgbuf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue