Просмотр исходного кода

Merge branch 'master' into next

* master:
  Fix OPs engaging the mass flood protection
  Hardcore vap0r into wraith
Bryan Drewery 14 лет назад
Родитель
Сommit
7e001f2feb
4 измененных файлов с 22 добавлено и 15 удалено
  1. 1 0
      doc/CREDITS
  2. 1 0
      doc/UPDATES
  3. 1 0
      src/cmds.c
  4. 19 15
      src/mod/irc.mod/chan.c

+ 1 - 0
doc/CREDITS

@@ -24,6 +24,7 @@ Credits and thanks to the following:
 * insect for helping test the RBL code.
 * Phillip for ideas / code.
 * ducch for ideas / findings bugs / code.
+* vap0r for providing the best raps and beats (http://wepump.in/music)
 * Many others.
 
 For a list of code Contributors see: git shortlog -sen master

+ 1 - 0
doc/UPDATES

@@ -9,6 +9,7 @@ maint
   * Don't allow running as root
   * Don't allow more than 5 bots per binary.
   * Fix CAPS/COLOR flood detection not obeying x|x flags
+  * Fix OPs engaging the mass flood protection
 
 1.4.0 - http://wraith.botpack.net/milestone/1.4.0
   * Updated server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.

+ 1 - 0
src/cmds.c

@@ -423,6 +423,7 @@ static void cmd_about(int idx, char *par)
   dprintf(idx, STR(" * $binsect$b for helping test the RBL code.\n"));
   dprintf(idx, STR(" * $bPhillip$b for ideas / code.\n"));
   dprintf(idx, STR(" * $bducch$b for ideas / findings bugs / code.\n"));
+  dprintf(idx, STR(" * $bvap0r$b for providing the best raps and beats (http://wepump.in/music)\n"));
   dprintf(idx, STR(" * $bMany$b others.\n"));
   dprintf(idx, " \n");
   dprintf(idx, STR("For a list of Contributors see: git shortlog -sen master\n"));

+ 19 - 15
src/mod/irc.mod/chan.c

@@ -663,22 +663,26 @@ static bool detect_chan_flood(memberlist* m, const char *from, struct chanset_t
       return 0;
     }
 
-    bd::HashTable<flood_t, time_t>      *global_floodtime = &(*chan->channel.floodtime)["all"];
-    bd::HashTable<flood_t, int>         *global_floodnum = &(*chan->channel.floodnum)["all"];
+    // No point locking down due to OPs flooding.
+    if (!chan_hasop(m)) {
 
-    if ((*global_floodtime)[which] < now - mlapse) {
-      /* Flood timer expired, reset it */
-      (*global_floodtime)[which] = now;
-      (*global_floodnum)[which] = increment;
-    } else {
-      (*global_floodnum)[which] += increment;
-
-      if ((*global_floodnum)[which] >= mthr) {	/* FLOOD */
-        /* Reset counters */
-        (*global_floodnum).remove(which);
-        (*global_floodtime).remove(which);
-        if (!chan->channel.drone_set_mode) {
-          lockdown_chan(chan, FLOOD_MASS_FLOOD, ftype);
+      bd::HashTable<flood_t, time_t>      *global_floodtime = &(*chan->channel.floodtime)["all"];
+      bd::HashTable<flood_t, int>         *global_floodnum = &(*chan->channel.floodnum)["all"];
+
+      if ((*global_floodtime)[which] < now - mlapse) {
+        /* Flood timer expired, reset it */
+        (*global_floodtime)[which] = now;
+        (*global_floodnum)[which] = increment;
+      } else {
+        (*global_floodnum)[which] += increment;
+
+        if ((*global_floodnum)[which] >= mthr) {	/* FLOOD */
+          /* Reset counters */
+          (*global_floodnum).remove(which);
+          (*global_floodtime).remove(which);
+          if (!chan->channel.drone_set_mode) {
+            lockdown_chan(chan, FLOOD_MASS_FLOOD, ftype);
+          }
         }
       }
     }