comparison tj.tcl @ 621:a1efc28ef5a4

tj: Require #-prefix for ids in 'delete' command.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 10 Feb 2021 15:26:10 +0200
parents 47b15186373f
children 84a30765baa1
comparison
equal deleted inserted replaced
620:47b15186373f 621:a1efc28ef5a4
400 if {!$nitem} { 400 if {!$nitem} {
401 tj_msg $upublic $unick $uchan "no_results" [list $uname] 401 tj_msg $upublic $unick $uchan "no_results" [list $uname]
402 } 402 }
403 403
404 } elseif {[tj_cmd_match "delete" $rcmd]} { 404 } elseif {[tj_cmd_match "delete" $rcmd]} {
405 # !tj delete <id> 405 # !tj delete #<id>
406 if {![utl_arg_get $rarglist rindex uid 0]} { 406 if {![utl_arg_get $rarglist rindex rarg 0] || ![tj_get_id $rarg rindex uid]} {
407 tj_msg $upublic $unick $uchan "help_delete" 407 tj_msg $upublic $unick $uchan "help_delete"
408 return 1 408 return 1
409 } 409 }
410 410
411 set usql "SELECT COUNT(*) FROM tj WHERE uuser='[utl_escape $uhand]' AND uid LIKE '[utl_escape $uid]'" 411 set usql "SELECT COUNT(*) FROM tj WHERE uuser='[utl_escape $uhand]' AND uid LIKE '[utl_escape $uid]'"