0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-03 22:28:52 +02:00

Send forward channel when bans are added/removed because of TS/bursts.

If a netburst adds bans or a channel TS change removes bans, +b/-b modes
are generated. Make sure these contain the forward channel, if any.

This appears also broken in ircd-seven.
This commit is contained in:
Jilles Tjoelker 2012-02-17 00:09:39 +01:00
parent 7f0fc87d3c
commit 23f6b63af6
2 changed files with 10 additions and 3 deletions

View file

@ -1268,7 +1268,8 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p,
banptr = ptr->data; banptr = ptr->data;
/* trailing space, and the mode letter itself */ /* trailing space, and the mode letter itself */
plen = strlen(banptr->banstr) + 2; plen = strlen(banptr->banstr) +
(banptr->forward ? strlen(banptr->forward) + 1 : 0) + 2;
if(count >= MAXMODEPARAMS || (cur_len + plen) > BUFSIZE - 4) if(count >= MAXMODEPARAMS || (cur_len + plen) > BUFSIZE - 4)
{ {
@ -1286,7 +1287,10 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p,
*mbuf++ = c; *mbuf++ = c;
cur_len += plen; cur_len += plen;
pbuf += rb_sprintf(pbuf, "%s ", banptr->banstr); if (banptr->forward)
pbuf += rb_sprintf(pbuf, "%s$%s ", banptr->banstr, banptr->forward);
else
pbuf += rb_sprintf(pbuf, "%s ", banptr->banstr);
count++; count++;
free_ban(banptr); free_ban(banptr);

View file

@ -346,7 +346,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
{ {
*forward++ = '\0'; *forward++ = '\0';
if(*forward == '\0') if(*forward == '\0')
forward = NULL; tlen--, forward = NULL;
} }
if(add_id(fakesource_p, chptr, s, forward, banlist, mode_type)) if(add_id(fakesource_p, chptr, s, forward, banlist, mode_type))
@ -366,6 +366,9 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
plen = modecount = 0; plen = modecount = 0;
} }
if (forward != NULL)
forward[-1] = '$';
*mbuf++ = parv[3][0]; *mbuf++ = parv[3][0];
arglen = rb_sprintf(pbuf, "%s ", s); arglen = rb_sprintf(pbuf, "%s ", s);
pbuf += arglen; pbuf += arglen;