]> git.donarmstrong.com Git - infobot.git/commitdiff
- forgot about interval for floodCycle.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 31 Jan 2001 13:16:43 +0000 (13:16 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 31 Jan 2001 13:16:43 +0000 (13:16 +0000)
- added nuh{} check to &leakCheck()
- added chanserv checking to &ircCheck()

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@277 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/IRC/Schedulers.pl

index f34ac510a22dac3fd714d2cf22eef1f728b25313..a1ffb7ddf648aaf8dbbce18b27755f88bf4296e0 100644 (file)
@@ -355,10 +355,11 @@ sub floodCycle {
     }
 
     my $time   = time();
+    my $interval       = &getChanConfDefault("floodCycle","",60);
+
     foreach $who (keys %flood) {
        foreach (keys %{$flood{$who}}) {
            if (!exists $flood{$who}{$_}) {
-# or !defined $flood{$who}{$_}) {
                &WARN("flood{$who}{$_} undefined?");
                next;
            }
@@ -370,7 +371,6 @@ sub floodCycle {
        }
     }
     &VERB("floodCycle: deleted $delete items.",2);
-
 }
 
 sub seenFlush {
@@ -479,9 +479,24 @@ sub leakCheck {
            }
        }
     }
+
+    my $delete = 0;
+    foreach (keys %nuh) {
+       next if (&IsNickInAnyChan($_));
+       delete $nuh{$_};
+       $delete++;
+    }
+
+    &DEBUG("$delete nuh{} items deleted; now have ".
+                               scalar(keys %nuh) ) if ($delete);
 }
 
 sub ignoreCheck {
+    if (@_) {
+       &ScheduleThis(60, "ignoreCheck");
+       &ScheduleChecked("ignoreCheck");
+    }
+
     my $time   = time();
     my $count  = 0;
 
@@ -504,8 +519,6 @@ sub ignoreCheck {
        }
     }
     &VERB("ignore: $count items deleted.",2);
-
-    &ScheduleThis(60, "ignoreCheck") if (@_);
 }
 
 sub ircCheck {
@@ -516,6 +529,14 @@ sub ircCheck {
        &FIXME("ircCheck: current channels * 2 <= config channels. FIXME.");
     }
 
+    # chanserv ops.
+    foreach ( &ChanConfList("chanServ_ops") ) {
+       next if (exists $channels{$chan}{'o'}{$ident});
+
+       &status("ChanServ ==> Requesting ops for $chan.");
+       &rawout("PRIVMSG ChanServ :OP $chan $ident");
+    }
+
     if (!$conn->connected and time - $msgtime > 3600) {
        &WARN("ircCheck: no msg for 3600 and disco'd! reconnecting!");
        $msgtime = time();      # just in case.
@@ -532,11 +553,12 @@ sub ircCheck {
 
     if (grep /^\s*$/, keys %channels) {
        &WARN("we have a NULL chan in hash channels? removing!");
-       delete $channels{''};
-       &status("channels now:");
+       delete $channels{''};   # ???
+       &DEBUG("channels now:");
        foreach (keys %channels) {
            &status("  $_");
        }
+       &DEBUG("channels END");
     }
 
     ### USER FILE.
@@ -837,6 +859,7 @@ sub getChanConfDefault {
     my($what, $chan, $default) = @_;
 
     if (exists $param{$what}) {
+       &DEBUG("backward-compat: found param{$what} instead.");
        return $param{$what};
     }