[beirc-cvs] CVS beirc

rgoldman rgoldman at common-lisp.net
Tue Mar 21 15:23:35 UTC 2006


Update of /project/beirc/cvsroot/beirc
In directory clnet:/tmp/cvs-serv26685

Modified Files:
	application.lisp 
Log Message:
Added *auto-connect-list*, which initially defaults to NIL.  As the
name suggests, beirc will attempt to connect to these servers
automagically on startup.

Auto-connect is achieved by :after method on adopt-frame added in this
file.  Idea courtesy of CLIM Guided Tour article.


--- /project/beirc/cvsroot/beirc/application.lisp	2006/03/17 17:44:22	1.65
+++ /project/beirc/cvsroot/beirc/application.lisp	2006/03/21 15:23:35	1.66
@@ -582,12 +582,20 @@
 (define-beirc-command (com-names :name t) ()
   (irc:names (current-connection *application-frame*) (target)))
 
-(define-beirc-command (com-away :name t) ((reason 'mumble :prompt "reason"))
+(define-beirc-command (com-away :name t) ((reason 'mumble
+						  :prompt (if (away-status *application-frame* (current-connection *application-frame*))
+							      "reason: to come back from away use /back instead of away"
+							      "reason")))
   (irc:away (current-connection *application-frame*) reason))
 
 (define-beirc-command (com-back :name t) ()
   (irc:away (current-connection *application-frame*) ""))
 
+(defmethod command-enabled ((command-name (eql 'com-back)) frame)
+  "Turn off the back command when it's not appropriate -- i.e., when you are 
+not away."
+  (away-status frame (current-connection frame)))
+
 (define-beirc-command (com-quit :name t) (&key (reason 'mumble :prompt "reason" :default "Client Quit"))
   (disconnect-all *application-frame* reason)
   (frame-exit *application-frame*))
@@ -997,3 +1005,13 @@
 (defmethod allocate-space :after ((pane climi::viewport-pane) w h)
   (let ((pane (first (sheet-children pane))))
     (redisplay-frame-pane (pane-frame pane) pane)))
+
+;;; proposed addition to auto-connect to servers in the
+;;; *auto-connect-list* [2006/03/21:rpg]
+(defmethod adopt-frame :after (frame-manager (frame beirc))
+  (declare (ignore frame-manager))
+  (loop for server in *auto-connect-list*
+	do (execute-frame-command frame
+		   `(com-connect ,server))))
+
+




More information about the Beirc-cvs mailing list