number flag)
(case flag
(read
- (elmo-msgdb-unset-flag msgdb number 'new)
(elmo-msgdb-unset-flag msgdb number 'unread))
(uncached
(elmo-msgdb-unset-flag msgdb number 'cached))
(t
- (let* ((cur-flags (modb-standard-message-flags msgdb number))
- (new-flags (copy-sequence cur-flags))
- diff)
- (or (memq flag new-flags)
- (setq new-flags (cons flag new-flags)))
- (when (and (eq flag 'unread)
- (memq 'answered new-flags))
- (setq new-flags (delq 'answered new-flags)))
- (unless (equal new-flags cur-flags)
+ (let ((cur-flags (modb-standard-message-flags msgdb number))
+ new-flags diff)
+ (unless (memq flag cur-flags)
+ (setq new-flags (cons flag cur-flags))
(setq diff (elmo-list-diff new-flags cur-flags))
(modb-standard-countup-flags msgdb (car diff))
(modb-standard-countup-flags msgdb (cadr diff) -1)
(elmo-clear-hash-val (modb-standard-key number)
(modb-standard-flag-map msgdb)))
(t
- (let* ((cur-flags (modb-standard-message-flags msgdb number))
- (new-flags (copy-sequence cur-flags))
- diff)
- (and (memq flag new-flags)
- (setq new-flags (delq flag new-flags)))
- (when (and (eq flag 'unread)
- (memq 'answered new-flags))
- (setq new-flags (delq 'answered new-flags)))
- (unless (equal new-flags cur-flags)
+ (let ((cur-flags (modb-standard-message-flags msgdb number))
+ new-flags diff)
+ (when (memq flag cur-flags)
+ (setq new-flags (delq flag (copy-sequence cur-flags)))
(setq diff (elmo-list-diff new-flags cur-flags))
(modb-standard-countup-flags msgdb (car diff))
(modb-standard-countup-flags msgdb (cadr diff) -1)
(elmo-set-hash-val (modb-standard-key number)
(cons number new-flags)
(modb-standard-flag-map msgdb))
- (modb-standard-set-flag-modified msgdb number))))))
+ (modb-standard-set-flag-modified msgdb number))
+ (when (eq flag 'unread)
+ (elmo-msgdb-unset-flag msgdb number 'new))))))
(luna-define-method elmo-msgdb-flag-count ((msgdb modb-standard))
(modb-standard-flag-count-internal msgdb))