Bladeren bron

* Bail out of check_chan_flood earlier if checking ourself

svn: 1675
Bryan Drewery 21 jaren geleden
bovenliggende
commit
5e17105505
1 gewijzigde bestanden met toevoegingen van 8 en 6 verwijderingen
  1. 8 6
      src/mod/irc.mod/chan.c

+ 8 - 6
src/mod/irc.mod/chan.c

@@ -330,6 +330,13 @@ static bool detect_chan_flood(char *floodnick, char *floodhost, char *from,
   if (!chan || (which < 0) || (which >= FLOOD_CHAN_MAX))
     return 0;
 
+  /* Okay, make sure i'm not flood-checking myself */
+  if (match_my_nick(floodnick))
+    return 0;
+  if (!egg_strcasecmp(floodhost, botuserhost))
+    return 0;
+  /* My user@host (?) */
+
   /* Do not punish non-existant channel members and IRC services like
    * ChanServ
    */
@@ -391,12 +398,7 @@ static bool detect_chan_flood(char *floodnick, char *floodhost, char *from,
   }
   if ((thr == 0) || (lapse == 0))
     return 0;			/* no flood protection */
-  /* Okay, make sure i'm not flood-checking myself */
-  if (match_my_nick(floodnick))
-    return 0;
-  if (!egg_strcasecmp(floodhost, botuserhost))
-    return 0;
-  /* My user@host (?) */
+
   if ((which == FLOOD_KICK) || (which == FLOOD_DEOP))
     p = floodnick;
   else {