From ehuelsmann at common-lisp.net Fri May 4 10:54:15 2007 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 4 May 2007 06:54:15 -0400 (EDT) Subject: [cl-irc-cvs] r205 - trunk Message-ID: <20070504105415.D879A1008@common-lisp.net> Author: ehuelsmann Date: Fri May 4 06:54:12 2007 New Revision: 205 Modified: trunk/command.lisp Log: Make privmsg work for dcc CHAT connections. Modified: trunk/command.lisp ============================================================================== --- trunk/command.lisp (original) +++ trunk/command.lisp Fri May 4 06:54:12 2007 @@ -228,6 +228,10 @@ (defmethod privmsg ((connection connection) (channel channel) (message string)) (privmsg connection (name channel) message)) +(defmethod privmsg ((connection dcc-chat-connection) target message) + (declare (ignore target)) + (send-dcc-message connection message)) + (defmethod notice ((connection connection) (target string) (message string)) (send-irc-message connection :notice target message)) From ehuelsmann at common-lisp.net Fri May 4 17:36:22 2007 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 4 May 2007 13:36:22 -0400 (EDT) Subject: [cl-irc-cvs] r206 - trunk Message-ID: <20070504173622.D8348581F8@common-lisp.net> Author: ehuelsmann Date: Fri May 4 13:36:22 2007 New Revision: 206 Modified: trunk/command.lisp Log: Make DCC commands and responses work with dcc CHAT connections. Modified: trunk/command.lisp ============================================================================== --- trunk/command.lisp (original) +++ trunk/command.lisp Fri May 4 13:36:22 2007 @@ -387,7 +387,6 @@ (defmethod ctcp-reply ((connection connection) target message) (send-irc-message connection :notice target (make-ctcp-message message))) - ;; Intermezzo: Manage outstanding offers (defvar *passive-offer-sequence-token* 0) @@ -465,7 +464,12 @@ ;; or do active request (error "Active DCC initiating not (yet) supported."))) -(defmethod dcc-request-cancel (connection token) +(defmethod ctcp-chat-initiate ((connection dcc-chat-connection) + nickname &key passive) + (declare (ignore nickname passive)) + (error "Chat connection already in progress")) + +(defmethod dcc-request-cancel ((connection connection) token) (dcc-remove-offer connection token) (if (stringp token) (let ((offer (dcc-offer-get connection token))) @@ -483,6 +487,9 @@ |# ))) +(defmethod dcc-request-cancel ((connection dcc-chat-connection) token) + (dcc-request-cancel (irc-connection connection) token)) + (defmethod dcc-request-accept ((message ctcp-dcc-chat-request-message)) ;; There are 2 options here: it was an active dcc offer or a passive one ;; For now, we'll support only active offers (where we act as a client) @@ -537,12 +544,22 @@ :socket socket :network-stream (usocket:socket-stream socket)))))))) +(defmethod dcc-request-accept ((message dcc-ctcp-dcc-chat-request-message)) + (error "DCC Chat already in progress")) + (defmethod dcc-request-reject ((message ctcp-dcc-chat-request-message) &optional reason) (ctcp-reply (connection message) (source message) (format nil "ERRMSG DCC CHAT ~A" (if reason reason "rejected")))) +(defmethod dcc-request-reject ((message dcc-ctcp-dcc-chat-request-message) + &optional reason) + (ctcp-reply (irc-connection (connection message)) + (nickname (user (connection message))) + (format nil "ERRMSG DCC CHAT ~A" (if reason reason + "rejected")))) + ;; ;; IRC commands which make some sence in a DCC CHAT context ;;