mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-04 08:23:12 +02:00
Fix chanmode +f issue where unsetting parts were not effective.
For example: '+f [5j#i1,5m#m1,3n]:3' and then '+f [5j#i1,5m]:3' In that case the '3n' was not removed and still effective, as could be seen by a '/MODE #chan'. Reported by The_Myth (#4883).
This commit is contained in:
@@ -396,6 +396,14 @@ void *cmodef_put_param(void *fld_in, char *param)
|
||||
fld = MyMallocEx(sizeof(ChanFloodProt));
|
||||
}
|
||||
|
||||
/* always reset settings (l, a, r) */
|
||||
for (v=0; v < NUMFLD; v++)
|
||||
{
|
||||
fld->l[v] = 0;
|
||||
fld->a[v] = 0;
|
||||
fld->r[v] = 0;
|
||||
}
|
||||
|
||||
/* '['<number><1 letter>[optional: '#'+1 letter],[next..]']'':'<number> */
|
||||
|
||||
p2 = strchr(xbuf+1, ']');
|
||||
@@ -518,6 +526,15 @@ void *cmodef_put_param(void *fld_in, char *param)
|
||||
MyFree(fld);
|
||||
return NULL;
|
||||
}
|
||||
/* if new 'per xxx seconds' is smaller than current 'per' then reset timers/counters (t, c) */
|
||||
if (v < fld->per)
|
||||
{
|
||||
for (v=0; v < NUMFLD; v++)
|
||||
{
|
||||
fld->t[v] = 0;
|
||||
fld->c[v] = 0;
|
||||
}
|
||||
}
|
||||
fld->per = v;
|
||||
|
||||
/* Is anything turned on? (to stop things like '+f []:15' */
|
||||
|
||||
Reference in New Issue
Block a user