]> jfr.im git - irc/freenode/syn.git/commitdiff
masks.c: actually set last_matched on the proper mask(s)
authorJanik Kleinhoff <redacted>
Fri, 19 Apr 2019 18:59:17 +0000 (18:59 +0000)
committerJanik Kleinhoff <redacted>
Fri, 19 Apr 2019 18:59:17 +0000 (18:59 +0000)
Fixes only the last mask processed being updated (whether or not it
actually matched), instead updating all masks that do match (reported or
not).

We also no longer stop processing when handling an exempt mask since
otherwise we'd update last_matched for all *previous* matching masks,
which would be quite counterintuitive.

masks.c

diff --git a/masks.c b/masks.c
index 598aa82c318ea664ea19cdeac14814b67731c842..7ec59297253e3583e64cf44ae2a4fc2c807aeb4b 100644 (file)
--- a/masks.c
+++ b/masks.c
@@ -221,6 +221,8 @@ void masks_newuser(hook_user_nick_t *data)
         if (! regex_match(m->re, nuh))
             continue;
 
+        m->last_match = CURRTIME;
+
         switch (m->type)
         {
             case mask_exempt:
@@ -236,13 +238,8 @@ void masks_newuser(hook_user_nick_t *data)
             case mask_unknown:
                 break;
         }
-
-        if (exempt)
-            break;
     }
 
-    m->last_match = CURRTIME;
-
     if (exempt == 1)
         return;