2005-01-13 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+ * elmo.el (elmo-message-fetch-with-cache-process): Abolish.
+ (elmo-message-fetch): Merge from
+ `elmo-message-fetch-with-cache-process'.
+
+ * elmo-sendlog.el (elmo-message-fetch-with-cache-process): Abolish.
+ (elmo-message-fetch): Define.
+
+ * elmo-nntp.el (elmo-message-fetch): Renamed from
+ `elmo-message-fetch-with-cache-process'.
+
+ * elmo-cache.el (elmo-message-fetch-with-cache-process): Abolish.
+ (elmo-message-fetch): Define.
+
* elmo-util.el (elmo-condition-parse-primitive): Downcase
search-key.
(elmo-cache-folder-directory-internal folder))))
t)
-(luna-define-method elmo-message-fetch-with-cache-process
- ((folder elmo-cache-folder) number strategy &optional section unseen)
+(luna-define-method elmo-message-fetch
+ ((folder elmo-cache-folder) number strategy &optional unseen section)
;; disbable cache process
- (elmo-message-fetch-internal folder number strategy section unseen))
+ (erase-buffer)
+ (when (elmo-message-fetch-internal folder number strategy section unseen)
+ (when (and (not unseen)
+ (elmo-message-flagged-p folder number 'unread))
+ (elmo-message-unset-flag folder number 'unread))
+ t))
(luna-define-method elmo-map-message-fetch ((folder elmo-cache-folder)
location strategy
(with-current-buffer (elmo-network-session-buffer session)
(std11-field-body "Newsgroups")))))
-(luna-define-method elmo-message-fetch-with-cache-process :around
- ((folder elmo-nntp-folder) number strategy &optional section unread)
+(luna-define-method elmo-message-fetch :around
+ ((folder elmo-nntp-folder) number strategy &optional unread section)
(when (luna-call-next-method)
(elmo-nntp-setup-crosspost-buffer folder number)
(unless unread
(message "Creating msgdb...done")
new-msgdb))
-(luna-define-method elmo-message-fetch-with-cache-process
- ((folder elmo-sendlog-folder) number strategy &optional section unseen)
+(luna-define-method elmo-message-fetch
+ ((folder elmo-sendlog-folder) number strategy &optional unseen section)
;; disbable cache process
- (elmo-message-fetch-internal folder number strategy section unseen))
+ (erase-buffer)
+ (when (elmo-message-fetch-internal folder number strategy section unseen)
+ (when (and (not unseen)
+ (elmo-message-flagged-p folder number 'unread))
+ (elmo-message-unset-flag folder number 'unread))
+ t))
(luna-define-method elmo-map-message-fetch ((folder elmo-sendlog-folder)
location strategy
SECTION of the message is fetched (if possible).
Returns non-nil if fetching was succeed.")
-(luna-define-generic elmo-message-fetch-with-cache-process (folder
- number strategy
- &optional
- section
- unread)
- "Fetch a message into current buffer with cache process.
-FOLDER is the ELMO folder structure.
-NUMBER is the number of the message in the FOLDER.
-STRATEGY is the message fetching strategy.
-If optional argument SECTION is specified, only the SECTION of the message
-is fetched (if possible).
-If second optional argument UNREAD is non-nil, message is not flaged as read.
-Returns non-nil if fetching was succeed.")
-
(luna-define-generic elmo-message-fetch-internal (folder number strategy
&optional
section
unread
section)
(erase-buffer)
- (when (elmo-message-fetch-with-cache-process folder number
- strategy section unread)
- (when (and (not unread)
- (elmo-message-flagged-p folder number 'unread))
- (elmo-message-unset-flag folder number 'unread
- ;; If cache does not exists, update only msgdb.
- ;; otherwise, flag status on server should be
- ;; changed since it is never touched at this
- ;; point.
- (not (elmo-message-flagged-p
- folder number 'cached))))
- t))
-
-(luna-define-method elmo-message-fetch-with-cache-process ((folder elmo-folder)
- number strategy
- &optional
- section unread)
(let ((cache-path (elmo-fetch-strategy-cache-path strategy))
(method-priorities
(cond ((eq (elmo-fetch-strategy-use-cache strategy) 'maybe)
'(cache entity))
(t
'(entity))))
- result err)
+ result err updated-server-flag)
(while (and method-priorities
- (null result))
+ (not result))
(setq result
(case (car method-priorities)
(cache
unread)
(error (setq err error) nil))
(> (buffer-size) 0))
+ (setq updated-server-flag t)
(when (and (elmo-fetch-strategy-save-cache strategy)
cache-path)
(elmo-file-cache-save cache-path section))
t)))
method-priorities (cdr method-priorities)))
- (or result
- (and err (signal (car err) (cdr err))))))
+ (if result
+ (when (and (not unread)
+ (elmo-message-flagged-p folder number 'unread))
+ (elmo-message-unset-flag folder number 'unread updated-server-flag))
+ (when err
+ (signal (car err) (cdr err))))
+ result))
(defun elmo-folder-kill-messages-range (folder beg end)
(elmo-folder-set-killed-list-internal