mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
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];
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue