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
;;