[cl-irc-cvs] r190 - trunk

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Sun Apr 22 20:01:45 UTC 2007


Author: ehuelsmann
Date: Sun Apr 22 16:01:44 2007
New Revision: 190

Modified:
   trunk/parse-message.lisp
Log:
Other DCC protocols starting with an #\S have been introduced now (SCHAT,SSEND).

Modified: trunk/parse-message.lisp
==============================================================================
--- trunk/parse-message.lisp	(original)
+++ trunk/parse-message.lisp	Sun Apr 22 16:01:44 2007
@@ -118,17 +118,21 @@
                     type)
       type
       nil))
-                                                       
+
 (defun dcc-type-p (string type)
   "Is the `string' actually a representation of the DCC `type'?"
-  (case type
-    (:dcc-chat-request
-     (when (string-equal (char string 5) #\C)
-       :dcc-chat-request))
-    (:dcc-send-request
-     (when (string-equal (char string 5) #\S)
-       :dcc-send-request))
-    (otherwise nil)))
+  (let* ((args (tokenize-string (string-trim (list +soh+) string)))
+         (dcc (string-upcase (first args)))
+         (type (string-upcase (second args))))
+    (when (string= dcc "DCC")
+      (case type
+        (:dcc-chat-request
+         (when (string= type "CHAT")
+           :dcc-chat-request))
+        (:dcc-send-request
+         (when (string= type "SEND")
+           :dcc-send-request))
+        (otherwise nil)))))
 
 (defun ctcp-message-type (string)
   "If `string' is a CTCP message, return the type of the message or



More information about the cl-irc-cvs mailing list