X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=blobdiff_plain;f=ircd%2Fchannel.c;h=8c6e38e8694bae4ca8f284cc347b9dee7fd0d7ba;hp=9de97d3755d5f65c516c8e6bfc2eeab9e2a74d64;hb=19214d33e4bc4ff5361aae9abe552dc418e7d3c9;hpb=21ced3d1658353412b92c551df8b095022449c82 diff --git a/ircd/channel.c b/ircd/channel.c index 9de97d3..8c6e38e 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -2589,10 +2589,13 @@ mode_parse_altchan(struct ParseState *state, ulong64 *flag_p) modebuf_mode_string(state->mbuf, state->dir | flag_p[0], t_str, 0); if (state->flags & MODE_PARSE_SET) { - if (state->dir == MODE_DEL) /* remove the old altchan */ + if (state->dir == MODE_DEL) { /* remove the old altchan */ *state->chptr->mode.altchan = '\0'; - else + state->chptr->mode.mode &= ~flag_p[0]; + } else { ircd_strncpy(state->chptr->mode.altchan, t_str, CHANNELLEN); + state->chptr->mode.mode |= flag_p[0]; + } } } @@ -2684,10 +2687,13 @@ mode_parse_noflood(struct ParseState *state, ulong64 *flag_p) modebuf_mode_string(state->mbuf, state->dir | flag_p[0], t_str, 0); if (state->flags & MODE_PARSE_SET) { - if (state->dir == MODE_DEL) /* remove the old noflood */ + if (state->dir == MODE_DEL) { /* remove the old noflood */ *state->chptr->mode.noflood = '\0'; - else + state->chptr->mode.mode &= ~flag_p[0]; + } else { ircd_strncpy(state->chptr->mode.noflood, t_str, CHANNELLEN); + state->chptr->mode.mode |= flag_p[0]; + } } if (state->dir == MODE_ADD) { @@ -2699,6 +2705,7 @@ mode_parse_noflood(struct ParseState *state, ulong64 *flag_p) state->chptr->mode.noflood_value = noflood_value; } else { //removed the mode so free all flood objects + state->chptr->mode.noflood_value = 0; struct Membership *member; for(member = state->chptr->members; member; member = member->next_member) { struct MemberFlood *floodnode; @@ -4364,7 +4371,7 @@ int ext_amsg_block(struct Client *cptr, struct Channel *chptr, const char *msg) * --pk910 2011/7/1 */ int ext_noflood_block(struct Client *cptr, struct Channel *chptr) { - if(chptr->mode.noflood == NULL || !chptr->mode.noflood) return 0; + if(!*chptr->mode.noflood) return 0; struct Membership *member = find_member_link(chptr, cptr); if(!member) return 0; //TODO: we've no check for -n channels implemented, yet //check if this user is really affected by +f