chiark / gitweb /
ypp-chatlog-alerter: working bell disablement
[ypp-sc-tools.db-test.git] / ypp-chatlog-alerter
index 275d7b5fc3d1e55f23311b73959e7a19e1a906c3..05a9c2001c7e516b8a8292db51ac0d11313c9194 100755 (executable)
@@ -282,7 +282,8 @@ proc message {pirate msg} {
     set ix [lsearch -exact $pirates $pirate]
     set now [clock seconds]
     
-    if {$ix<0 || [lindex $times $ix] < $now-$bell_again} {
+    if {$bell_again > -2 &&
+       ($ix<0 || [lindex $times $ix] < $now-$bell_again)} {
        bell -nice
     }
     if {$ix < 0} {
@@ -319,7 +320,7 @@ proc parseargs {} {
        if {![string compare $arg --test-tints]} {
            showtints
        } elseif {![string compare $arg --no-bell]} {
-           set bell_again -1
+           set bell_again -2
        } else {
            error "unknown option $arg"
        }