]> git.donarmstrong.com Git - infobot.git/commitdiff
- adding/forgeting factoids work
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 24 Nov 2002 16:50:25 +0000 (16:50 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 24 Nov 2002 16:50:25 +0000 (16:50 +0000)
- old dbReplace used () for hash ref, woops!

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@710 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/Factoids/Update.pl

index 885538280735b9268d4fbc4f890cd21d37bfe8da..322f501e0a924123db57da745ffd62693ae0a939 100644 (file)
@@ -55,7 +55,7 @@ sub update {
     # freshmeat
     if (&IsChanConf("freshmeatForFactoid")) {
        # todo: "name" is invalid for fm ][
-       if ( &dbGet("freshmeat", "name", "name=".&dbQuote($lhs)) ) {
+       if ( &sqlSelect("freshmeat", "name", { name => $lhs } ) ) {
            &msg($who, "permission denied. (freshmeat)");
            &status("alert: $who wanted to teach me something that freshmeat already has info on.");
            return 1;
@@ -107,12 +107,12 @@ sub update {
 
        &performAddressedReply("okay");
 
-       &dbReplace("factoids", "factoid_key", (
+       &sqlReplace("factoids", {
                created_by      => $nuh,
                created_time    => time(),      # modified time.
                factoid_key     => $lhs,
                factoid_value   => $rhs,
-       ) );
+       } );
 
        if (!defined $rhs or $rhs eq "") {
            &ERROR("Update: rhs1 == NULL.");
@@ -219,7 +219,7 @@ sub update {
        $count{'Update'}++;
        &status("update: <$who> \'$lhs\' =$mhs=> \'$rhs\'; was \'$exists\'");
 
-       # should dbReplace be used here?
+       # todo: use sqlReplace.
        #&delFactoid($lhs); # breaks dbm. leave it and use modified_* - Tim Riker <Tim@Rikers.org>
        &setFactInfo($lhs,"modified_by", $nuh);
        &setFactInfo($lhs,"modified_time", time());