]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/IrcHooks.pl
- second round of changes from lear@OPN. thanks!
[infobot.git] / src / IRC / IrcHooks.pl
index b4b31f6d8cc8f0a1e82a5044ec2f2b329251f26e..1a77e32a3ce2ee3480072faaa030b8cdde51dfd6 100644 (file)
@@ -353,7 +353,8 @@ sub on_disconnect {
     $ircstats{'DisconnectTime'}                = time();
     $ircstats{'DisconnectReason'}      = $what;
     $ircstats{'DisconnectCount'}++;
-    $ircstats{'TotalTime'}     += time() - $ircstats{'ConnectTime'};
+    $ircstats{'TotalTime'}     += time() - $ircstats{'ConnectTime'}
+                                       if ($ircstats{'ConnectTime'});
 
     # clear any variables on reconnection.
     $nickserv = 0;
@@ -858,7 +859,7 @@ sub on_public {
            );
                
 
-           &dbReplace("stats", %hash);
+           &dbReplace("stats", "nick", %hash);
            # does not work, atleast with old mysql!!! :(
 #          &dbReplace("stats", (nick => $who, type => $x, -counter => "counter+1") );
        }