]> git.donarmstrong.com Git - infobot.git/commitdiff
fix delayed task mechanism to verstats... we have to cache chan/nick/msgType.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 8 Feb 2001 14:00:43 +0000 (14:00 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 8 Feb 2001 14:00:43 +0000 (14:00 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@362 c11ca15a-4712-0410-83d8-924469b57eb5

src/CommandStubs.pl

index 1b7f132aeea69d01cbf8ea8e5f376387c45020a2..695139a10e057b26a35f88ee5a4a74a97568e651 100644 (file)
@@ -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{$_} };