-2001-12-11 Yuuichi Teranishi <teranisi@gohome.org>
+2001-12-10 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-imap4.el (elmo-imap4-process-bye): New function.
+ (elmo-imap4-send-command): Call elmo-imap4-process-bye.
+ (elmo-imap4-accept-ok): Ditto.
+ (elmo-imap4-session-select-mailbox): If argument `no-error' equals to
+ 'notify-bye, only BYE error is reported.
+ (elmo-folder-exists-p-plugged): Set no-error argument of
+ `elmo-imap4-session-select-mailbox' as 'notify-bye.
+
+ * elmo.el (elmo-imap4-bye-error): Changed message.
* elmo-dop.el (elmo-dop-queue-flush): Fixed obsolete version message.
(elmo-dop-queue-flush): Don't append to the dop-queue while flushing
;; (erase-buffer) No need.
(goto-char (point-min))
(when (elmo-imap4-response-bye-p elmo-imap4-current-response)
- (elmo-network-close-session session)
- (signal 'elmo-imap4-bye-error
- (list (elmo-imap4-response-error-text
- elmo-imap4-current-response))))
+ (elmo-imap4-process-bye session))
(setq elmo-imap4-current-response nil)
(if elmo-imap4-parsing
(error "IMAP process is running. Please wait (or plug again.)"))
(elmo-network-session-process-internal session))
'continue-req))
+(defun elmo-imap4-process-bye (session)
+ (with-current-buffer (elmo-network-session-buffer session)
+ (let ((r elmo-imap4-current-response))
+ (setq elmo-imap4-current-response nil)
+ (elmo-network-close-session session)
+ (signal 'elmo-imap4-bye-error
+ (list (concat (elmo-imap4-response-error-text r))
+ "Try Again")))))
+
(defun elmo-imap4-accept-continue-req (session)
"Returns non-nil if `+' (continue-req) response is arrived in SESSION.
If response is not `+' response, cause an error."
(if (elmo-imap4-response-ok-p response)
response
(if (elmo-imap4-response-bye-p response)
- (progn
- (elmo-network-close-session session)
- (signal 'elmo-imap4-bye-error
- (list (elmo-imap4-response-error-text response))))
+ (elmo-imap4-process-bye session)
(error "IMAP error: %s"
(or (elmo-imap4-response-error-text response)
"No `OK' response from server."))))))
-
-
;;; MIME-ELMO-IMAP Location
(luna-define-method mime-imap-location-section-body ((location
mime-elmo-imap-location)
is same as MAILBOX.
If second optional argument NO-ERROR is non-nil, don't cause an error when
selecting folder was failed.
+If NO-ERROR is 'notify-bye, only BYE response is reported as error.
Returns response value if selecting folder succeed. "
(when (or force
(not (string=
session
(nth 1 (assq 'read-only (assq 'ok response)))))
(elmo-imap4-session-set-current-mailbox-internal session nil)
- (unless no-error
- (error (or
- (elmo-imap4-response-error-text response)
- (format "Select %s failed" mailbox))))))
+ (if (and (eq no-error 'notify-bye)
+ (elmo-imap4-response-bye-p response))
+ (elmo-imap4-process-bye session)
+ (unless no-error
+ (error (or
+ (elmo-imap4-response-error-text response)
+ (format "Select %s failed" mailbox)))))))
(and result response))))
(defun elmo-imap4-check-validity (spec validity-file)
(elmo-imap4-session-select-mailbox
session
(elmo-imap4-folder-mailbox-internal folder)
- 'force 'no-error))))
+ 'force 'notify-bye))))
(luna-define-method elmo-folder-writable-p ((folder elmo-imap4-folder))
t)