(defconst modb-legacy-flag-list
'(new unread important answered cached read uncached)
- "A list of flag symbol which is suppoted by legacy msgdb.")
+ "A list of flag symbol which is supported by legacy msgdb.")
(eval-and-compile
(luna-define-class modb-legacy (modb-generic)
;;;
-(defsubst modb-legacy-suppoted-flag-p (flag)
+(defsubst modb-legacy-supported-flag-p (flag)
(memq flag modb-legacy-flag-list))
(defvar modb-legacy-unread-marks-internal nil)
(luna-define-method elmo-msgdb-length ((msgdb modb-legacy))
(length (modb-legacy-overview-internal msgdb)))
+(luna-define-method elmo-msgdb-flag-available-p ((msgdb modb-legacy) flag)
+ (modb-legacy-supported-flag-p flag))
+
(luna-define-method elmo-msgdb-flags ((msgdb modb-legacy) number)
(modb-legacy-mark-to-flags (elmo-msgdb-get-mark msgdb number)))
(luna-define-method elmo-msgdb-set-flag ((msgdb modb-legacy)
number flag)
- (unless (modb-legacy-suppoted-flag-p flag)
- (error "Flag `%s' is not supproted by this msgdb type"
+ (unless (modb-legacy-supported-flag-p flag)
+ (error "Flag `%s' is not supported by this msgdb type"
(capitalize (symbol-name flag))))
(case flag
(read
(luna-define-method elmo-msgdb-unset-flag ((msgdb modb-legacy)
number flag)
- (unless (modb-legacy-suppoted-flag-p flag)
- (error "Flag `%s' is not supproted by this msgdb type"
+ (unless (or (modb-legacy-supported-flag-p flag)
+ (eq flag 'all))
+ (error "Flag `%s' is not supported by this msgdb type"
(capitalize (symbol-name flag))))
(case flag
(read
(let ((number (elmo-msgdb-overview-entity-get-number-internal entity))
(message-id (elmo-msgdb-overview-entity-get-id-internal entity))
mark cell)
- (elmo-msgdb-set-overview
- msgdb
- (nconc (elmo-msgdb-get-overview msgdb)
- (list entity)))
- (elmo-msgdb-set-number-alist
- msgdb
- (nconc (elmo-msgdb-get-number-alist msgdb)
- (list (cons number message-id))))
- (modb-generic-set-message-modified-internal msgdb t)
- (when (setq mark (modb-legacy-flags-to-mark flags))
- (setq cell (list number mark))
- (elmo-msgdb-set-mark-alist
+ (when (and number message-id)
+ (elmo-msgdb-set-overview
msgdb
- (nconc (elmo-msgdb-get-mark-alist msgdb) (list cell)))
- (modb-generic-set-flag-modified-internal msgdb t))
- (elmo-msgdb-make-index
- msgdb
- (list entity)
- (and cell (list cell))))))
+ (nconc (elmo-msgdb-get-overview msgdb)
+ (list entity)))
+ (elmo-msgdb-set-number-alist
+ msgdb
+ (nconc (elmo-msgdb-get-number-alist msgdb)
+ (list (cons number message-id))))
+ (modb-generic-set-message-modified-internal msgdb t)
+ (when (setq mark (modb-legacy-flags-to-mark flags))
+ (setq cell (list number mark))
+ (elmo-msgdb-set-mark-alist
+ msgdb
+ (nconc (elmo-msgdb-get-mark-alist msgdb) (list cell)))
+ (modb-generic-set-flag-modified-internal msgdb t))
+ (elmo-msgdb-make-index
+ msgdb
+ (list entity)
+ (and cell (list cell)))))))
(luna-define-method elmo-msgdb-delete-messages ((msgdb modb-legacy)
numbers)