From 3ad21e31002618fdd0cdfd1346e78d3302f597e7 Mon Sep 17 00:00:00 2001 From: hmurata Date: Thu, 6 Nov 2003 10:13:49 +0000 Subject: [PATCH] * modb-standard.el (elmo-msgdb-set-flag): Simplify; Undo last change (move to elmo-msgdb-unset-flag). (elmo-msgdb-unset-flag): Simplify; Unset 'new flag when unread flag is unset. --- elmo/ChangeLog | 7 +++++++ elmo/modb-standard.el | 31 +++++++++++-------------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index a352af9..42aeb1c 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,10 @@ +2003-11-06 Hiroya Murata + + * modb-standard.el (elmo-msgdb-set-flag): Simplify; + Undo last change (move to elmo-msgdb-unset-flag). + (elmo-msgdb-unset-flag): Simplify; Unset 'new flag when unread + flag is unset. + 2003-11-05 Yuuichi Teranishi * modb-standard.el (elmo-msgdb-set-flag): Unset 'new flag when diff --git a/elmo/modb-standard.el b/elmo/modb-standard.el index a8e4d6a..23d2580 100644 --- a/elmo/modb-standard.el +++ b/elmo/modb-standard.el @@ -291,20 +291,14 @@ 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) @@ -327,22 +321,19 @@ (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)) -- 1.7.10.4