# HG changeset patch # User Matti Hamalainen # Date 1613471200 -7200 # Node ID bc87660aa400e5326378ad7744ee020944dba2a7 # Parent 68b8cf87e86ea0bfdd049fb6e41f21b70331fa40 tj: Add max items as configurable setting. diff -r 68b8cf87e86e -r bc87660aa400 config.tj.example --- a/config.tj.example Mon Feb 15 13:42:42 2021 +0200 +++ b/config.tj.example Tue Feb 16 12:26:40 2021 +0200 @@ -36,6 +36,9 @@ set tj_db_file "tj.sqlite" +set tj_max_items 5 + + # Default time (hh:mm) when not specified set tj_default_time "12:00" diff -r 68b8cf87e86e -r bc87660aa400 tj.tcl --- a/tj.tcl Mon Feb 15 13:42:42 2021 +0200 +++ b/tj.tcl Tue Feb 16 12:26:40 2021 +0200 @@ -207,7 +207,7 @@ # ------------------------------------------------------------------------ proc tj_cmd {unick $uhost uhand uchan uargs upublic} { - global tj_messages tj_default_id tj_default_time tj_default_desc + global tj_messages tj_default_id tj_default_time tj_default_desc tj_max_items # Check if we have a valid user if {![utl_valid_user $uhand]} { @@ -344,8 +344,8 @@ } # Check for maximum reminders - if {$nitems > 5} { - tj_msg $upublic $unick $uchan "err_too_many" [list $nitems] + if {$nitems >= $tj_max_items} { + tj_msg $upublic $unick $uchan "err_too_many" [list $nitems $tj_max_items] return 1 }