From b0a2d58f2be4255ed2b5ae041a9c6a2a9aa44d6a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 31 Jan 2002 18:54:41 +0000 Subject: [PATCH] Tidy it up a bit and improve the FIXMEs --- bot.tcl | 55 +++++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/bot.tcl b/bot.tcl index 3a22713..8f25e29 100755 --- a/bot.tcl +++ b/bot.tcl @@ -145,12 +145,31 @@ proc looking_whenwhere {when where} { return $str } +proc check_telling {nl event} { + # for all except `talk' we delay 750ms + switch -exact $event { + none { + } + talk { + check_telling_core $nl talk + check_telling_core $nl act + } + act - come { + after 750 [list check_telling_core $nl $event] + } + default { + error "check_telling $nl $event" + } + } +} + proc check_telling_core {nl event} { # event is `talk', `act' or `come' -FIXME - delay 750ms when you invoke this, except for `talk' - which causes `talk' now and `act' later + # When user talks we actually get talk now and act later FIXME - make it be called with come -FIXME - +FIXME - implement all cmds +FIXME - implement tells_deliver set stt [list $u passed $now] +FIXME - implement tells_delete catch { unset stt } ? set iml [msgdb_get $nl inbound] if {![llength $iml]} return @@ -228,7 +247,7 @@ FIXME - t??prv?v { # consider delivered: # (very recently passed, and the user talks) - tell_delete {} $nl + tells_delete {} $nl } t??????? { # ignore @@ -252,6 +271,7 @@ FIXME - # and should not pass) sendprivmsg $nl \ {You have messages (so identify yourself please).}] + set stt [list $u mentioned $now] } * { error "check_telling_core nl=$nl evstate=$evstate ?" @@ -259,31 +279,6 @@ FIXME - } } - - - } - - - { - } - ns???u - - - - if {[ - set security - - switch -exact - - if {![info exists u]} { catch { unset telling } } - && [info exists telling]} { - - - } - - if {![info exists telling]} { - - proc recordlastseen_n {n how here} { global lastseen lookedfor set nl [irctolower $n] @@ -292,7 +287,7 @@ proc recordlastseen_n {n how here} { if {!$here} return - check_telling $nl [lindex {x act talk} $here] + check_telling $nl [lindex {none act talk} $here] upvar #0 lookedfor($nl) lf if {[info exists lf]} { -- 2.11.0