+2002-10-24 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * elmo-msgdb.el (elmo-msgdb-set-flag): Use
+ `elmo-file-cache-exists-p'; use proper mark that depends on
+ `use-cache'.
+ (elmo-msgdb-unset-flag): Ditto.
+ (elmo-msgdb-set-cached): Ditto. added argument `use-cache'.
+
+ * elmo.el (elmo-message-set-cached): Call `elmo-msgdb-set-cached'
+ with 4th argument `use-cache'.
+
2002-10-18 Yuuichi Teranishi <teranisi@gohome.org>
* elmo.el (elmo-folder-unmark-important): Follow the changes above.
;; return value.
t))
-(defun elmo-msgdb-set-cached (msgdb number cached)
+(defun elmo-msgdb-set-cached (msgdb number cached use-cache)
"Set message cache status.
If mark is changed, return non-nil."
(let* ((cur-mark (elmo-msgdb-get-mark msgdb number))
'answered)
((not (member cur-mark (elmo-msgdb-unread-marks)))
'read)))
- (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks)))))
+ (cur-cached (elmo-file-cache-exists-p
+ (elmo-msgdb-get-field msgdb number 'message-id))))
(unless (eq cached cur-cached)
(case cur-flag
(read
(elmo-msgdb-set-mark msgdb number
- (unless cached
- elmo-msgdb-read-uncached-mark)))
+ (if (and use-cache (not cached))
+ elmo-msgdb-read-uncached-mark)))
(important nil)
(answered
(elmo-msgdb-set-mark msgdb number
'answered)
((not (member cur-mark (elmo-msgdb-unread-marks)))
'read)))
- (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks))))
+ (cur-cached (elmo-file-cache-exists-p
+ (elmo-msgdb-get-field msgdb number 'message-id)))
mark-modified)
(case flag
(read
(unless (or (eq cur-flag 'answered) (eq cur-flag 'important))
(elmo-msgdb-set-mark msgdb number
(if cur-cached
- (if use-cache
- elmo-msgdb-answered-cached-mark
- elmo-msgdb-answered-uncached-mark)
+ elmo-msgdb-answered-cached-mark
elmo-msgdb-answered-uncached-mark)))
(setq mark-modified t)))
(if mark-modified (elmo-folder-set-mark-modified-internal folder t))))
'answered)
((not (member cur-mark (elmo-msgdb-unread-marks)))
'read)))
- (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks))))
+ (cur-cached (elmo-file-cache-exists-p
+ (elmo-msgdb-get-field msgdb number 'message-id)))
mark-modified)
(case flag
(read
(when (eq cur-flag 'read)
(elmo-msgdb-set-mark msgdb number
- (if (and cur-cached use-cache)
+ (if cur-cached
elmo-msgdb-unread-cached-mark
elmo-msgdb-unread-uncached-mark))
(setq mark-modified t)))
(answered
(when (eq cur-flag 'answered)
(elmo-msgdb-set-mark msgdb number
- (if (and cur-cached (not use-cache))
+ (if (and use-cache (not cur-cached))
elmo-msgdb-read-uncached-mark))
(setq mark-modified t))))
(if mark-modified (elmo-folder-set-mark-modified-internal folder t))))
FOLDER is the ELMO folder structure.
NUMBER is a number of the message.
If CACHED is t, message mark is set as cached."
- (when (elmo-msgdb-set-cached
- (elmo-folder-msgdb folder) number cached)
+ (when (elmo-msgdb-set-cached (elmo-folder-msgdb folder)
+ number
+ cached
+ (elmo-message-use-cache-p folder number))
(elmo-folder-set-mark-modified-internal folder t)))