]> git.donarmstrong.com Git - infobot.git/commitdiff
stats are per channel instead of global ('PRIVATE') only
authortroubled-irc <troubled-irc@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 12 Mar 2007 21:12:04 +0000 (21:12 +0000)
committertroubled-irc <troubled-irc@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 12 Mar 2007 21:12:04 +0000 (21:12 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1317 c11ca15a-4712-0410-83d8-924469b57eb5

ChangeLog
src/Process.pl
src/UserExtra.pl

index 51a679387e4557b424a09100b7fad62f2c5e4f38..d3ffba8a16c255109f7d6e552373c3a363bb3f94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-03-11 22:00  troubled
+
+       * src/{Process.pl,UserExtra.pl}: Fixed bug with karma stats. It
+         wasnt supplying the channel and causing a dupe pkey issue and
+         also resulted in global stats instead of per channel. Stats
+         are now per channel again. As a result, you should probably:
+         DELETE FROM stats WHERE channel = 'PRIVATE' AND "type" = 'karma';
+         to clean up since they will never match now, or be pointless to
+         keep track of because karma can only be done in channel.
+
 2007-03-08 00:00  troubled
 
        * files/sample/blootbot.config: set tempDir changed to /tmp and
index f9cd46c26b6dd77459f39c8b8dddb9eb99a8f3e3..d2f1e5e9b8bd0c4d1126b3d86af3519d63776424 100644 (file)
@@ -309,16 +309,14 @@ sub process {
        }
 
        my $karma = &sqlSelect("stats", "counter",
-               { nick => $term, type => "karma" }) || 0;
+               { nick => $term, type => "karma", channel => $chan }) || 0;
        if ($inc eq '++') {
            $karma++;
        } else {
            $karma--;
        }
 
-       &sqlSet("stats", {'nick' => $term}, {
-           nick        => $term,
-           type        => "karma",
+       &sqlSet("stats", {'nick' => $term, type => "karma", channel => $chan}, {
            'time'      => time(),
            counter     => $karma,
        } );
index b139ad6a9f1d9424e3a664ff5f1f28d5436c9813..6d1223b82ed27d09f12caa1ba8b85f9ddec419bd 100644 (file)
@@ -192,7 +192,7 @@ sub factstats {
 sub karma {
     my $target = lc( shift || $who );
     my $karma  = &sqlSelect("stats", "counter",
-       { nick => $target, type => "karma" }) || 0;
+       { nick => $target, type => "karma", channel => $chan }) || 0;
 
     if ($karma != 0) {
        &performStrictReply("$target has karma of $karma");