+proc check_telling {nl event} {
+ # event is `talk', `act' or `come'
+
+ set iml [msgdb_get $nl inbound]
+ if {![llength $iml]} return
+
+ upvar #0 nick_telling($nl) telling
+ upvar #0 nick_unique($nl) u
+
+ if {[info exists telling]} {
+ manyset $telling u2 stt telling_when
+ if {"$u2" != "$u"} { unset telling; unset stt; unset telling_when }
+ }
+
+ if {![info exists stt]} {
+ set stt norecord
+ set telling_when $now
+ }
+
+ set ago [expr {$now - $telling_when}]
+
+ # evstate is string of letters
+ # event
+ # t talk
+ # a act
+ # c come
+ # current state
+ # n NORECORD
+ # m MENTIONED
+ # p PASSED
+ # security level and timing
+ # ii Insecure
+ # ss Secure and soon (before interval)
+ # sl Secure and late (after interval)
+ # reliability and timing
+ # uu Unreliable
+ # rv Remind, very soon (before within-interval)
+ # rs Remind, soon (between)
+ # rl Remind, late (aftr every-interval)
+ # ps Pester, soon (before interval)
+ # pl Pester, late (after interval)
+ # current identification
+ # i Identified
+ # u Unidentified
+ # current visibility
+ # v Visible
+ # h Hidden (invisible, no unique)
+
+ set evstate [string range $stt 0 0]
+
+ manyset [nickdb_get $n tellsec] sec secwhen
+ switch -exact $sec {
+ insecure { append evstate ii }
+ secure { append evstate [expr {$ago<$secwhen ? "sl" : "ss"}] }
+ default { append evstate "#$sec#" }
+ }
+
+ manyset [nickdb_set $n tellrel] rel relint relwithin
+ switch -exact $rel {
+ unreliable { append evstate uu }
+ remind { append evstate [expr {
+ $ago<$relwithin ? "rv" : $ago<$relint ? "rs" : "rl"
+ }]}
+ pester { append evstate [expr {$ago<$relint ? "ps" : "pl"}] }
+ default { append evstate "#$rel#" }
+ }
+
+ upvar #0 nick_username($nl) nu
+ if {[info exists nu] && "$nu" == "[nickdb_get $nl username]"} {
+ append evstate i
+ } else {
+ append evstate u
+ }
+
+ append evstate [expr {[info exists u] ? "v" : "h"}]
+
+ switch -glob $evstate {
+
+
+
+
+ if {[
+ set security
+
+ switch -exact
+
+ if {![info exists u]} { catch { unset telling } }
+ && [info exists telling]} {
+
+
+ }
+
+ if {![info exists telling]} {
+
+