emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 178/255: process igs "tell" messages


From: Eric Schulte
Subject: [elpa] 178/255: process igs "tell" messages
Date: Sun, 16 Mar 2014 01:02:44 +0000

eschulte pushed a commit to branch go
in repository elpa.

commit a2d731adff96280ac93777f13b87a072020f7cff
Author: Eric Schulte <address@hidden>
Date:   Sun Jun 10 17:53:33 2012 -0600

    process igs "tell" messages
---
 back-ends/igs.el |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/back-ends/igs.el b/back-ends/igs.el
index 6078fa9..056c8f2 100644
--- a/back-ends/igs.el
+++ b/back-ends/igs.el
@@ -132,10 +132,12 @@ This is used to re-send messages to keep the IGS server 
from timing out.")
            (content (match-string 2 string)))
       (case type
         (:prompt (igs-w-proc proc (setq *igs-ready* t)))
-        (:info   (message "igs-info: %s" content))
+        (:info   (unless (string= content "yes")
+                   (message "igs-info: %s" content)))
         (:games  (igs-w-proc proc (igs-handle-game content)))
         (:move   (igs-w-proc proc (igs-handle-move content)))
         (:kibitz (message "igs-kibitz: %s" content))
+        (:tell   (igs-handle-tell content))
         (:beep   nil)
         (t       (message "igs-unknown: [%s]%s" type content)))
       (when (> (time-to-seconds (time-since *igs-time-last-sent*))
@@ -312,6 +314,14 @@ This is used to re-send messages to keep the IGS server 
from timing out.")
 
 (defsetf igs-current-game set-igs-current-game)
 
+(defun igs-handle-tell (string)
+  (unless (string-match (format "\\*\\(%s\\)\\*: \\(.*\\)$" igs-player-name-re)
+                        string)
+    (error "igs: malformed tell string %S" string))
+  ;; TODO: keep a message buffer for each user in which conversations
+  ;;       may be saved... during games store messages as SGF comments.
+  (message "igs[%s]: %s" (match-string 1 string) (match-string 2 string)))
+
 (defun igs-apply-move (move)
   (if (aget (igs-current-game) :board)
       (setf (go-move (aget (igs-current-game) :board)) move)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]