From 000a528d8233d55afc13009b829d361edc50fa9d Mon Sep 17 00:00:00 2001 From: dms Date: Wed, 31 Jan 2001 13:16:43 +0000 Subject: [PATCH] - forgot about interval for floodCycle. - 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 | 35 ++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/blootbot/src/IRC/Schedulers.pl b/blootbot/src/IRC/Schedulers.pl index f34ac51..a1ffb7d 100644 --- a/blootbot/src/IRC/Schedulers.pl +++ b/blootbot/src/IRC/Schedulers.pl @@ -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}; } -- 2.39.5