]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/Schedulers.pl
wingate -> Wingate
[infobot.git] / src / IRC / Schedulers.pl
index 932dd941e4fa2e953eb36acd350a02cec3f3e041..9fbe0c8cc5c64c03780ff9bfc3171b9b2c5794e7 100644 (file)
@@ -370,6 +370,7 @@ sub newsFlush {
 
 sub chanlimitCheck {
     my $interval = &getChanConfDefault("chanlimitcheckInterval", 10);
+    my $mynick=$conn->nick();
 
     if (@_) {
        &ScheduleThis($interval, "chanlimitCheck");
@@ -411,7 +412,7 @@ sub chanlimitCheck {
            next;
        }
 
-       if (!exists $channels{$chan}{'o'}{$ident}) {
+       if (!exists $channels{$chan}{'o'}{$mynick}) {
            &status("chanlimit: dont have ops on $chan.") unless (exists $cache{warn}{chanlimit}{$chan});
            $cache{warn}{chanlimit}{$chan} = 1;
            &chanServCheck($chan);
@@ -678,6 +679,7 @@ sub ircCheck {
     $cache{statusSafe} = 1;
     foreach (sort keys %conns) {
        $conn=$conns{$_};
+       my $mynick=$conn->nick();
        &DEBUG("ircCheck for $_");
        my @join = &getJoinChans(1);
        if (scalar @join) {
@@ -697,7 +699,7 @@ sub ircCheck {
            } else {
                &status('ircCheck: possible lost in space; checking.'.
                    scalar(gmtime) );
-               &msg($ident, "TEST");
+               &msg($mynick, "TEST");
                $cache{connect} = time();
            }
        }
@@ -841,11 +843,11 @@ sub getNickInUse {
 
 sub uptimeLoop {
     return if (!defined &uptimeWriteFile);
-#    return unless &IsChanConf("uptime");
+#    return unless &IsChanConf('Uptime');
 
     if (@_) {
-       &ScheduleThis(60, "uptimeLoop");
-       return if ($_[0] eq "2");       # defer.
+       &ScheduleThis(60, 'uptimeLoop');
+       return if ($_[0] eq '2');       # defer.
     }
 
     &uptimeWriteFile();
@@ -854,14 +856,14 @@ sub uptimeLoop {
 sub slashdotLoop {
 
     if (@_) {
-       &ScheduleThis(60, "slashdotLoop");
+       &ScheduleThis(60, 'slashdotLoop');
        return if ($_[0] eq "2");
     }
 
-    my @chans = &ChanConfList("slashdotAnnounce");
+    my @chans = &ChanConfList('slashdotAnnounce');
     return unless (scalar @chans);
 
-    &Forker("slashdot", sub {
+    &Forker('slashdot', sub {
        my $line = &Slashdot::slashdotAnnounce();
        return unless (defined $line);
 
@@ -877,14 +879,14 @@ sub slashdotLoop {
 sub plugLoop {
 
     if (@_) {
-       &ScheduleThis(60, "plugLoop");
+       &ScheduleThis(60, 'plugLoop');
        return if ($_[0] eq "2");
     }
 
-    my @chans = &ChanConfList("plugAnnounce");
+    my @chans = &ChanConfList('plugAnnounce');
     return unless (scalar @chans);
 
-    &Forker("plug", sub {
+    &Forker('Plug', sub {
        my $line = &Plug::plugAnnounce();
        return unless (defined $line);
 
@@ -922,14 +924,14 @@ sub kernelLoop {
 }
 
 sub wingateCheck {
-    return unless &IsChanConf("wingate");
+    return unless &IsChanConf('Wingate');
 
     ### FILE CACHE OF OFFENDING WINGATES.
     foreach (grep /^$host$/, @wingateBad) {
        &status("Wingate: RUNNING ON $host BY $who");
-       &ban("*!*\@$host", "") if &IsChanConf("wingateBan");
+       &ban("*!*\@$host", "") if &IsChanConf('wingateBan');
 
-       my $reason      = &getChanConf("wingateKick");
+       my $reason      = &getChanConf('wingateKick');
 
        next unless ($reason);
        &kick($who, "", $reason)
@@ -943,21 +945,21 @@ sub wingateCheck {
        &DEBUG("Already scanned $host. good.");
     }
 
-    my $interval = &getChanConfDefault("wingateInterval", 60); # seconds.
-    return if (defined $forked{'wingate'});
+    my $interval = &getChanConfDefault('wingateInterval', 60); # seconds.
+    return if (defined $forked{'Wingate'});
     return if (time() - $wingaterun <= $interval);
     return unless (scalar(keys %wingateToDo));
 
     $wingaterun = time();
 
-    &Forker("wingate", sub { &Wingate::Wingates(keys %wingateToDo); } );
+    &Forker('Wingate', sub { &Wingate::Wingates(keys %wingateToDo); } );
     undef @wingateNow;
 }
 
 ### TODO: ??
 sub wingateWriteFile {
     if (@_) {
-       &ScheduleThis(60, "wingateWriteFile");
+       &ScheduleThis(60, 'wingateWriteFile');
        return if ($_[0] eq "2");       # defer.
     }
 
@@ -965,7 +967,7 @@ sub wingateWriteFile {
 
     my $file = "$bot_base_dir/$param{'ircUser'}.wingate";
     if ($bot_pid != $$) {
-       &DEBUG("wingateWriteFile: Reorganising!");
+       &DEBUG('wingateWriteFile: Reorganising!');
 
        open(IN, $file);
        while (<IN>) {
@@ -979,7 +981,7 @@ sub wingateWriteFile {
        @wingateNow = sort keys %hash;
     }
 
-    &DEBUG("wingateWF: writing...");
+    &DEBUG('wingateWF: writing...');
     open(OUT, ">$file");
     foreach (@wingateNow) {
        print OUT "$_\n";