X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=blobdiff_plain;f=ircd%2Fchannel.c;fp=ircd%2Fchannel.c;h=5a17a6bf21df3d859703b819c3138ecb01c0f797;hp=7e9bb09d14b05c1fb3a70fad2e850281f2587940;hb=520bced72acf72c12bc6e9529954335afe74a6f5;hpb=b8402b9ef585580454491088f9581a1c3a8ca8ef diff --git a/ircd/channel.c b/ircd/channel.c index 7e9bb09..5a17a6b 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -2673,8 +2673,9 @@ mode_parse_noflood(struct ParseState *state, ulong64 *flag_p) else t_str++; //simply ignore if it's not an opmode tmp++; } - if(tmp[0] == '+' || tmp[0] == '@') { + if(tmp[0] == '+' || tmp[0] == '%' || tmp[0] == '@') { if(tmp[0] == '+') flags |= FLFL_VOICE; + if(tmp[0] == '%') flags |= FLFL_HALFOP; if(tmp[0] == '@') flags |= FLFL_CHANOP; tmp++; } @@ -2746,7 +2747,7 @@ mode_parse_noflood(struct ParseState *state, ulong64 *flag_p) unsigned int noflood_value = time; noflood_value <<= 10; noflood_value |= count; - noflood_value <<= 3; + noflood_value <<= 4; noflood_value |= flags; state->chptr->mode.noflood_value = noflood_value; } else { @@ -4430,15 +4431,17 @@ int ext_noflood_block(struct Client *cptr, struct Channel *chptr) { 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 - unsigned int flags = (chptr->mode.noflood_value & 0x00000007); //0000 0000 0000 0000 0000 0000 0000 0111 = 0x00000007 >> 0 - unsigned int count = (chptr->mode.noflood_value & 0x00001ff8) >> 3; //0000 0000 0000 0000 0001 1111 1111 1000 = 0x00001ff8 >> 3 - int time = (chptr->mode.noflood_value & 0x07ffe000) >> 13; //0000 0111 1111 1111 1110 0000 0000 0000 = 0x07ffe000 >> 13 + unsigned int flags = (chptr->mode.noflood_value & 0x0000000f); //0000 0000 0000 0000 0000 0000 0000 1111 = 0x0000000f >> 0 + unsigned int count = (chptr->mode.noflood_value & 0x00002ff0) >> 4; //0000 0000 0000 0000 0011 1111 1111 0000 = 0x00002ff0 >> 4 + int time = (chptr->mode.noflood_value & 0x0fffc000) >> 14; //0000 1111 1111 1111 1100 0000 0000 0000 = 0x0fffc000 >> 14 if(count == 0 || time == 0) return 0; if(!(flags & FLFL_NOFLOOD) && HasPriv(cptr, PRIV_FLOOD)) return 0; if(!(flags & FLFL_CHANOP) && (member->status & CHFL_CHANOP)) return 0; - if(!(flags & (FLFL_CHANOP | FLFL_VOICE)) && (member->status & CHFL_VOICE)) + if(!(flags & (FLFL_CHANOP | FLFL_HALFOP)) && (member->status & CHFL_HALFOP)) + return 0; + if(!(flags & (FLFL_CHANOP | FLFL_HALFOP | FLFL_VOICE)) && (member->status & CHFL_VOICE)) return 0; int floodcount = 0; struct MemberFlood *floodnode, *prev_floodnode;