if (!IsChannelName(t_str) || !strIsIrcCh(t_str) || strlen(t_str) > IRCD_MIN(CHANNELLEN, feature_int(FEAT_CHANNELLEN)) || t_str[0] == '&') /* only parse it if it's a valid channel name! */
return;
- struct Channel *chptr;
- struct Membership *member;
- if (!(chptr = FindChannel(t_str)))
+ if(!(state->flags & MODE_PARSE_FORCE)) {
+ struct Channel *chptr;
+ struct Membership *member;
+ if (!(chptr = FindChannel(t_str)))
return;
- if(!(member = find_member_link(chptr, state->sptr)))
+ if(!(member = find_member_link(chptr, state->sptr)))
return;
- if(!IsChanOp(member)) {
+ if(!IsChanOp(member)) {
send_notoper(state);
return;
+ }
}
if (!(state->flags & MODE_PARSE_WIPEOUT) &&
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];
+ }
}
}
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) {
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;
* --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