1
0
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:
Bram Matthys
2017-03-06 10:05:30 +01:00
parent 9252ce30e9
commit cb59538309
+17
View File
@@ -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' */