typedef int (*bqcmp)(const void *, const void *);
-static int m_cap(struct Client *, struct Client *, int, const char **);
+static int m_cap(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static int modinit(void);
struct Message cap_msgtab = {
- "CAP", 0, 0, 0, MFLG_SLOW,
+ "CAP", 0, 0, 0, 0,
{{m_cap, 2}, {m_cap, 2}, mg_ignore, mg_ignore, mg_ignore, {m_cap, 2}}
};
_CLICAP("tls", CLICAP_TLS, 0, 0, 0),
_CLICAP("userhost-in-names", CLICAP_USERHOST_IN_NAMES, 0, 0, 0),
_CLICAP("cap-notify", CLICAP_CAP_NOTIFY, 0, 0, 0),
+ _CLICAP("chghost", CLICAP_CHGHOST, 0, 0, 0),
};
#define CLICAP_LIST_LEN (sizeof(clicap_list) / sizeof(struct clicap))
int curlen, mlen;
size_t i;
- mlen = rb_sprintf(buf, ":%s CAP %s %s",
+ mlen = sprintf(buf, ":%s CAP %s %s",
me.name,
EmptyString(source_p->name) ? "*" : source_p->name,
subcmd);
buflen++;
}
- curlen = rb_sprintf(p, "%s ", clicap_list[i].name);
+ curlen = sprintf(p, "%s ", clicap_list[i].name);
p += curlen;
buflen += curlen;
}
if(EmptyString(arg))
return;
- buflen = rb_snprintf(buf, sizeof(buf), ":%s CAP %s ACK",
+ buflen = snprintf(buf, sizeof(buf), ":%s CAP %s ACK",
me.name, EmptyString(source_p->name) ? "*" : source_p->name);
pbuf[0][0] = '\0';
}
strcat(pbuf[i], cap->name);
- strcat(pbuf[i], " ");
- plen += (cap->namelen + 1);
+ if (!finished) {
+ strcat(pbuf[i], " ");
+ plen += (cap->namelen + 1);
+ }
}
if(!finished)
}
static int
-m_cap(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+m_cap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct clicap_cmd *cmd;