changeset 59:415c47fcc518

quotedb: Cleanups. We do not need to SELECT quoteID for these operations, we already know what it is.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Sep 2011 22:16:00 +0300
parents 0da3461eb871
children ce327469582c
files quotedb.tcl
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
     }
   }