+2002-08-11 OHASHI Akira <bg66@koka-in.org>
+
+ * liece-dcc.el (liece-dcc-dequeue-request): Do nothing when
+ `liece-dcc-requests' is empty.
+ (liece-command-dcc-accept): Ditto.
+ (liece-command-dcc-chat-connect): Ditto.
+
2002-07-15 Daiki Ueno <ueno@unixuser.org>
* liece-url.el (liece-url-regexp-alist): New user option.
(inline (queue-enqueue liece-dcc-requests request))))
(defun liece-dcc-dequeue-request (&optional type)
- (when (or (not type)
- (eq (liece-dcc-object-type
- (queue-first liece-dcc-requests))
- type))
+ (when (and (not (queue-empty liece-dcc-requests))
+ (or (not type)
+ (eq (liece-dcc-object-type
+ (queue-first liece-dcc-requests))
+ type)))
(inline (queue-dequeue liece-dcc-requests))))
(defmacro liece-dcc-add-to-process-alist (process type &rest args)
(defun liece-command-dcc-chat-connect (&optional number)
(interactive "P")
- (let* ((object (liece-dcc-dequeue-request 'chat))
- (nick (liece-dcc-object-from object))
- process)
- (if (not object)
- (liece-message (_ "DCC No chat request has been arrived."))
+ (if (queue-empty liece-dcc-requests)
+ (liece-message (_ "DCC No chat request has been arrived."))
+ (let* ((object (liece-dcc-dequeue-request 'chat))
+ (nick (liece-dcc-object-from object))
+ process)
(liece-dcc-message (_ "Connecting to: %s") nick)
(setq liece-privmsg-partner nick)
(setq process
(defun liece-command-dcc-accept ()
"Dispatch one DCC request."
(interactive)
- (let* ((object (queue-first liece-dcc-requests))
- (type (liece-dcc-object-type object)))
- (cond ((eq type 'send)
- (liece-command-dcc-receive))
- ((eq type 'chat)
- (liece-command-dcc-chat-connect))
- (t
- (liece-message
- (_ "DCC No request has been arrived."))))))
+ (if (queue-empty liece-dcc-requests)
+ (liece-message (_ "DCC No request has been arrived."))
+ (let* ((object (queue-first liece-dcc-requests))
+ (type (liece-dcc-object-type object)))
+ (cond ((eq type 'send)
+ (liece-command-dcc-receive))
+ ((eq type 'chat)
+ (liece-command-dcc-chat-connect))
+ (t
+ (liece-message
+ (_ "DCC No request has been arrived.")))))))
(defun liece-command-dcc-list ()
"List files in receive queue."