[beirc-cvs] CVS update: beirc/application.lisp

Max-Gerd Retzlaff mretzlaff at common-lisp.net
Fri Oct 7 00:03:16 UTC 2005


Update of /project/beirc/cvsroot/beirc
In directory common-lisp.net:/tmp/cvs-serv18334

Modified Files:
	application.lisp 
Log Message:
SEND-PRIVATE-MESSAGE is changed to do the same as the code in COM-SAY
(that is, the test (unless (or (string= what "") (null target)) has
been added). Therfore also:

The whole body of COM-SAY is now (com-msg (target) what).

The presentation-type of the parameter TARGET of COM-MSG has been
changed from 'nickname to '(OR nickname channel).

(Minor code reorganisation: SEND-PRIVATE-MESSAGE, COM-MSG, and COM-ME
are moved from the end of the application.lisp to the place where
COM-SAY is defined.)

Date: Fri Oct  7 02:03:16 2005
Author: mretzlaff

Index: beirc/application.lisp
diff -u beirc/application.lisp:1.32 beirc/application.lisp:1.33
--- beirc/application.lisp:1.32	Wed Oct  5 15:21:36 2005
+++ beirc/application.lisp	Fri Oct  7 02:03:15 2005
@@ -443,14 +443,35 @@
   (or (current-query)
       (current-channel)))
 
-(define-beirc-command (com-say :name t) ((what 'mumble))
-  (unless (or (string= what "") (null (target)))
+(defun send-private-message (target what)
+  (unless (or (string= what "")
+              (null target))
     (post-message *application-frame*
                   (make-fake-irc-message 'irc:irc-privmsg-message
                                          :trailing-argument what
-                                         :arguments (list (target))
+                                         :arguments (list target)
                                          :command "PRIVMSG"))
-    (irc:privmsg (current-connection *application-frame*) (target) what)))
+    (irc:privmsg (current-connection *application-frame*) target what)))
+
+(define-beirc-command (com-msg :name t)
+    ((target '(OR nickname channel) :prompt "who")
+     (what 'mumble :prompt "what"))
+  (send-private-message target what))
+
+(define-beirc-command (com-say :name t)
+    ((what 'mumble))
+  (com-msg (target) what))
+
+(define-beirc-command (com-me :name t) ((what 'mumble :prompt nil))
+  (with-slots (connection) *application-frame*
+    (let ((m (make-fake-irc-message 'irc:ctcp-action-message
+                                    :trailing-argument
+                                    (format nil "~AACTION ~A~A" (code-char 1) what (code-char 1))
+                                    :arguments (list (target))
+                                    :command "PRIVMSG"))) ;###
+      (post-message *application-frame* m)
+      (irc:privmsg connection (target)
+                   (format nil "~AACTION ~A~A" (code-char 1) what (code-char 1))))))
 
 (define-beirc-command (com-nick :name t) ((new-nick 'string :prompt "new nick"))
   (setf (slot-value *application-frame* 'nick) new-nick) ;This is _not_ the way to do it.
@@ -774,30 +795,3 @@
 (defmethod allocate-space :after ((pane climi::viewport-pane) w h)
   (let ((pane (first (sheet-children pane))))
     (redisplay-frame-pane (pane-frame pane) pane)))
-
-;;;;;;
-
-(define-beirc-command (com-me :name t) ((what 'mumble :prompt nil))
-  (with-slots (connection) *application-frame*
-    (let ((m (make-fake-irc-message 'irc:ctcp-action-message
-                                    :trailing-argument
-                                    (format nil "~AACTION ~A~A" (code-char 1) what (code-char 1))
-                                    :arguments (list (target))
-                                    :command "PRIVMSG"))) ;###
-      (post-message *application-frame* m)
-      (irc:privmsg connection (target)
-                   (format nil "~AACTION ~A~A" (code-char 1) what (code-char 1))))))
-
-(defun send-private-message (target what)
-  (post-message *application-frame*
-                (make-fake-irc-message 'irc:irc-privmsg-message
-                                       :trailing-argument what
-                                       :arguments (list target)
-                                       :command "PRIVMSG"))
-  (irc:privmsg (current-connection *application-frame*) target what))
-
-(define-beirc-command (com-msg :name t)
-    ((target 'nickname :prompt "who") (what 'mumble :prompt "what"))
-  (warn "~S ~S" target what)
-  (send-private-message target what) )
-




More information about the Beirc-cvs mailing list