# HG changeset patch # User Matti Hamalainen # Date 1315509360 -10800 # Node ID 415c47fcc51842ea6d0869b09501c93ff820f58c # Parent 0da3461eb871d94f504bc7bbc9e9ba878794600d quotedb: Cleanups. We do not need to SELECT quoteID for these operations, we already know what it is. diff -r 0da3461eb871 -r 415c47fcc518 quotedb.tcl --- a/quotedb.tcl Thu Sep 08 22:14:27 2011 +0300 +++ b/quotedb.tcl Thu Sep 08 22:16:00 2011 +0300 @@ -200,23 +200,23 @@ return 0 } - set usql "SELECT id AS quoteID, utime AS utime, utext AS utext, user AS uuser, host AS uhost FROM $utable WHERE id=$unum AND user='[qdb_escape $uhand]'" + set usql "SELECT utime AS utime FROM $utable WHERE id=$unum AND user='[qdb_escape $uhand]'" quotedb eval $usql { set udiff [expr [unixtime] - $utime] if {$udiff < $maxdiff} { - set usql "DELETE FROM $utable WHERE id=$quoteID AND user='[qdb_escape $uhand]'" + set usql "DELETE FROM $utable WHERE id=$unum AND user='[qdb_escape $uhand]'" if {![qdb_sql_exec $upublic $unick $uchan $usql]} { return 0 } else { - set usql "DELETE FROM ${utable}_votes WHERE urlid=$quoteID" + set usql "DELETE FROM ${utable}_votes WHERE urlid=$unum" if {![qdb_sql_exec $upublic $unick $uchan $usql]} { return 0 } - qdb_msg $upublic $unick $uchan "$utable ID #$quoteID poistettu." + qdb_msg $upublic $unick $uchan "$utable #$unum poistettu." return 1 } } else { - qdb_msg $upublic $unick $uchan "$utable quote #$quoteID vanhempi kuin $qdb_max_deltime minuuttia, ei poisteta." + qdb_msg $upublic $unick $uchan "$utable quote #$unum vanhempi kuin $qdb_max_deltime minuuttia, ei poisteta." return 0 } }