From: dms Date: Thu, 8 Feb 2001 14:00:43 +0000 (+0000) Subject: fix delayed task mechanism to verstats... we have to cache chan/nick/msgType. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5707682189d7c393dce02a3d7e2c3a0f83cb2edb;p=infobot.git fix delayed task mechanism to verstats... we have to cache chan/nick/msgType. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@362 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/CommandStubs.pl b/src/CommandStubs.pl index 1b7f132..695139a 100644 --- a/src/CommandStubs.pl +++ b/src/CommandStubs.pl @@ -674,14 +674,18 @@ sub do_verstats { &msg($who, "Sending CTCP VERSION..."); $conn->ctcp("VERSION", $chan); - $cache{verstats} = $chan; + $cache{verstats}{chan} = $chan; + $cache{verstats}{who} = $who; + $cache{verstats}{msgType} = $msgType; $conn->schedule(60, sub { my $vtotal = 0; - my $c = lc $cache{verstats}; + my $c = lc $cache{verstats}{chan}; my $total = keys %{ $channels{$c}{''} }; - delete $cache{verstats}; $chan = $c; + $who = $cache{verstats}{who}; + $msgType = $cache{verstats}{msgType}; + delete $cache{verstats}; # sufficient? foreach (keys %ver) { $vtotal += scalar keys %{ $ver{$_} };