]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/Schedulers.pl
fix more warnings
[infobot.git] / src / IRC / Schedulers.pl
index 5851b642c40fd8b996759cd500800533ad991ad6..d14c12ced7d040d1cf389e24b09fa2d4f2b85c41 100644 (file)
@@ -364,7 +364,11 @@ sub chanlimitCheck {
            ### run NAMES again and flush it.
        }
 
-       next unless (!defined $limit or $limit != $newlimit);
+       next unless (!defined $limit);
+       if ($limit == $newlimit) {
+           $cache{chanlimitChange}{$chan} = time();
+           next;
+       }
 
        if (!exists $channels{$chan}{'o'}{$ident}) {
            &status("ChanLimit: dont have ops on $chan.") unless (exists $cache{warn}{chanlimit}{$chan});
@@ -566,7 +570,7 @@ sub leakCheck {
        delete $sched{"leakCheck"}{RUNNING};
     }
 
-    # flood.
+    # flood. this is dealt with in floodLoop()
     foreach $blah1 (keys %flood) {
        foreach $blah2 (keys %{ $flood{$blah1} }) {
            $count += scalar(keys %{ $flood{$blah1}{$blah2} });
@@ -581,7 +585,7 @@ sub leakCheck {
            $count += scalar(keys %{ $floodjoin{$blah1}{$blah2} });
        }
     }
-    &DEBUG("leak: hash flood has $count total keys.",2);
+    &DEBUG("leak: hash floodjoin has $count total keys.",2);
 
     # floodwarn.
     $count = scalar(keys %floodwarn);
@@ -598,6 +602,11 @@ sub leakCheck {
        }
     }
 
+    # chanstats
+    $count = scalar(keys %chanstats);
+    &DEBUG("leak: hash chanstats has $count total keys.",2);
+
+    # nuh.
     my $delete = 0;
     foreach (keys %nuh) {
        next if (&IsNickInAnyChan($_));
@@ -646,11 +655,13 @@ sub ircCheck {
        delete $sched{"ircCheck"}{RUNNING};
     }
 
-    my @array = grep !/^_default$/, keys %chanconf;
-    my $iconf = scalar(@array);
-    my $inow  = scalar(keys %channels);
+    my @x      = &getJoinChans();
+    my $iconf  = scalar( @x );
+    my $inow   = scalar( keys %channels );
     if ($iconf > 2 and $inow * 2 <= $iconf) {
        &FIXME("ircCheck: current channels * 2 <= config channels. FIXME.");
+       @joinchan       = @x;
+       &joinNextChan();
     }
 
     if (!$conn->connected or time() - $msgtime > 3600) {
@@ -849,6 +860,7 @@ sub shmFlush {
 
 ### this is semi-scheduled
 sub getNickInUse {
+    &DEBUG("gNIU: ident => $ident, ircNick => $param{'ircNick'}");
     if ($ident eq $param{'ircNick'}) {
        &status("okay, got my nick back.");
        return;
@@ -1158,8 +1170,10 @@ sub mkBackup {
     }
     return unless ($backup);
 
+    my $age = &Time2String(time() - (stat $file)[9]);
+
     ### TODO: do internal copying.
-    &status("Backup: $file to $file~");
+    &status("Backup: $file ($age)");
     CORE::system("/bin/cp $file $file~");
 }