+2010-05-08 David Maus <dmaus@ictsoc.de>
+
+ * elmo-imap4.el (elmo-imap4-mailbox-selected-p): New macro.
+ Return non-nil if mailbox is selected in session.
+ (elmo-imap4-session-select-mailbox): Use macro
+ `elmo-imap4-mailbox-selected-p'.
+ (elmo-folder-exists-p-plugged): Dto.
+ (elmo-folder-check-plugged): Dto.
+ (elmo-imap4-folder-diff-plugged): Dto.
+
2010-05-05 David Maus <dmaus@ictsoc.de>
* elmo-imap4.el (elmo-imap4-mailbox-size-update-maybe): Use
`(and (memq ,capability (elmo-imap4-session-capability-internal ,session))
(not (memq ,capability elmo-imap4-disabled-extensions))))
+(defmacro elmo-imap4-mailbox-selected-p (mailbox session)
+ "Return non-nil if MAILBOX is selected in SESSION."
+ `(string= (elmo-imap4-session-current-mailbox-internal ,sessio) ,maibox))
+
;;; MIME-ELMO-IMAP Location
(eval-and-compile
(luna-define-class mime-elmo-imap-location
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=
- (elmo-imap4-session-current-mailbox-internal session)
- mailbox)))
+ (not (elmo-imap4-mailbox-selected-p mailbox session)))
(let (response result)
(unwind-protect
(setq response
(luna-define-method elmo-folder-exists-p-plugged ((folder elmo-imap4-folder))
(let ((session (elmo-imap4-get-session folder)))
- (if (string=
- (elmo-imap4-session-current-mailbox-internal session)
- (elmo-imap4-folder-mailbox-internal folder))
+ (if (elmo-imap4-mailbox-selected-p
+ (elmo-imap4-folder-mailbox-internal folder) session)
t
(elmo-imap4-session-select-mailbox
session
(luna-define-method elmo-folder-check-plugged ((folder elmo-imap4-folder))
(let ((session (elmo-imap4-get-session folder 'if-exists)))
(when session
- (if (string=
- (elmo-imap4-session-current-mailbox-internal session)
- (elmo-imap4-folder-mailbox-internal folder))
+ (if (elmo-imap4-mailbox-selected-p
+ (elmo-imap4-folder-mailbox-internal folder)
+ session)
(if elmo-imap4-use-select-to-update-status
(elmo-imap4-session-select-mailbox
session
(elmo-imap4-session-select-mailbox
session
(elmo-imap4-folder-mailbox-internal folder)))
- (if (string= (elmo-imap4-session-current-mailbox-internal session)
- (elmo-imap4-folder-mailbox-internal folder))
+ (if (elmo-imap4-mailbox-selected-p
+ (elmo-imap4-folder-mailbox-internal folder)
+ session)
(progn
(elmo-imap4-send-command-wait session "noop")
(setq unread (length (elmo-imap4-folder-list-flagged folder 'unread)))