aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lilykarma.tcl20
1 files changed, 11 insertions, 9 deletions
diff --git a/lilykarma.tcl b/lilykarma.tcl
index d804469..17b3b59 100644
--- a/lilykarma.tcl
+++ b/lilykarma.tcl
@@ -89,15 +89,6 @@ proc fixkarma {nick uhost hand chan text} {
return 0
}
}
- if {[kdb eval {SELECT locked FROM lkarma WHERE item=$item}] == "Y"} {
- set lockedk [kdb eval {SELECT karma FROM lkarma WHERE item=$item}]
- if {$lockedk == 0} {
- puthelp "PRIVMSG $chan :You can't change the karma of \002$item\002!"
- } {
- puthelp "PRIVMSG $chan :Karma for \002$item\002 is locked at \002$lockedk\002."
- }
- return 0
- }
set score [string range $text end-1 end]
if {[string match "++" $score]} {
@@ -106,6 +97,17 @@ proc fixkarma {nick uhost hand chan text} {
set scoring -1
}
+ if {[kdb eval {SELECT locked FROM lkarma WHERE item=$item}] == "Y"} {
+ set lockedk [kdb eval {SELECT karma FROM lkarma WHERE item=$item}]
+ puthelp "NOTICE $chan :\[karma\] '$item' now has $lockedk karma!"
+ if {[string match "++" $score]} {
+ puthelp "PRIVMSG $karma(logchan) :\[karma\] $nick!$uhost ($acct) ++'d locked '$item' in $chan - score: $lockedk"
+ } elseif {[string match "--" $score]} {
+ puthelp "PRIVMSG $karma(logchan) :\[karma\] $nick!$uhost ($acct) --'d locked '$item' in $chan - score: $lockedk"
+ }
+ return 0
+ }
+
if {![info exists kfcount($uhost)]} {
set kfcount($uhost) 0
}