chiark / gitweb /
Tidy it up a bit and improve the FIXMEs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 31 Jan 2002 18:54:41 +0000 (18:54 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 31 Jan 2002 18:54:41 +0000 (18:54 +0000)
bot.tcl

diff --git a/bot.tcl b/bot.tcl
index 3a227139ab1011bd4fb2a662a28eaa739abe9470..8f25e2977983a4807d9902148ea95511124c2558 100755 (executable)
--- 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]} {