src/channel: add support for IRCv3.2 userhost-in-names
This commit is contained in:
parent
6e3d57dc6b
commit
1b54aa5c3b
3 changed files with 34 additions and 15 deletions
|
@ -448,6 +448,7 @@ struct ListClient
|
|||
#define CLICAP_EXTENDED_JOIN 0x0008
|
||||
#define CLICAP_AWAY_NOTIFY 0x0010
|
||||
#define CLICAP_TLS 0x0020
|
||||
#define CLICAP_USERHOST_IN_NAMES 0x0040
|
||||
|
||||
/*
|
||||
* flags macros.
|
||||
|
|
|
@ -76,6 +76,7 @@ static struct clicap
|
|||
_CLICAP("extended-join", CLICAP_EXTENDED_JOIN, 0, 0, 0),
|
||||
_CLICAP("away-notify", CLICAP_AWAY_NOTIFY, 0, 0, 0),
|
||||
_CLICAP("tls", CLICAP_TLS, 0, 0, 0),
|
||||
_CLICAP("userhost-in-names", CLICAP_USERHOST_IN_NAMES, 0, 0, 0),
|
||||
};
|
||||
|
||||
#define CLICAP_LIST_LEN (sizeof(clicap_list) / sizeof(struct clicap))
|
||||
|
|
|
@ -465,6 +465,22 @@ channel_member_names(struct Channel *chptr, struct Client *client_p, int show_eo
|
|||
if(IsInvisible(target_p) && !is_member)
|
||||
continue;
|
||||
|
||||
if (IsCapable(client_p, CLICAP_USERHOST_IN_NAMES))
|
||||
{
|
||||
/* space, possible "@+" prefix */
|
||||
if (cur_len + strlen(target_p->name) + strlen(target_p->username) + strlen(target_p->host) + 5 >= BUFSIZE - 5)
|
||||
{
|
||||
*(t - 1) = '\0';
|
||||
sendto_one(client_p, "%s", lbuf);
|
||||
cur_len = mlen;
|
||||
t = lbuf + mlen;
|
||||
}
|
||||
|
||||
tlen = rb_sprintf(t, "%s%s!%s@%s ", find_channel_status(msptr, stack),
|
||||
target_p->name, target_p->username, target_p->host);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* space, possible "@+" prefix */
|
||||
if(cur_len + strlen(target_p->name) + 3 >= BUFSIZE - 3)
|
||||
{
|
||||
|
@ -476,6 +492,7 @@ channel_member_names(struct Channel *chptr, struct Client *client_p, int show_eo
|
|||
|
||||
tlen = rb_sprintf(t, "%s%s ", find_channel_status(msptr, stack),
|
||||
target_p->name);
|
||||
}
|
||||
|
||||
cur_len += tlen;
|
||||
t += tlen;
|
||||
|
|
Loading…
Reference in a new issue