+2004-04-23 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * elmo.el (elmo-message-flags): Add optional argument `msgid'.
+ (elmo-generic-folder-append-messages): Call elmo-message-flags
+ with argument `msgid'.
+
+ * elmo-split.el (elmo-split-subr): Ditto.
+
+ * elmo-pipe.el (elmo-message-flags): Follow the API change.
+
+ * elmo-multi.el (elmo-message-flags): Ditto.
+
2004-04-18 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* elmo.el (elmo-folder): Add new slot `flag-table'.
(let ((pair (elmo-multi-real-folder-number folder number)))
(elmo-message-field (car pair) (cdr pair) field)))
-(luna-define-method elmo-message-flags ((folder elmo-multi-folder) number)
+(luna-define-method elmo-message-flags ((folder elmo-multi-folder) number
+ &optional msgid)
(let ((pair (elmo-multi-real-folder-number folder number)))
- (elmo-message-flags (car pair) (cdr pair))))
+ (elmo-message-flags (car pair) (cdr pair) msgid)))
(defun elmo-multi-split-numbers (folder numlist &optional as-is)
(let ((numbers (sort numlist '<))
(luna-define-method elmo-folder-count-flags ((folder elmo-pipe-folder))
(elmo-folder-count-flags (elmo-pipe-folder-dst-internal folder)))
-(luna-define-method elmo-message-flags ((folder elmo-pipe-folder) number)
- (elmo-message-flags (elmo-pipe-folder-dst-internal folder) number))
+(luna-define-method elmo-message-flags ((folder elmo-pipe-folder) number
+ &optional msgid)
+ (elmo-message-flags (elmo-pipe-folder-dst-internal folder) number msgid))
(luna-define-method elmo-message-field ((folder elmo-pipe-folder)
number field)
nil (current-buffer) 'unread))
(run-hooks 'elmo-split-fetch-hook)
(setq elmo-split-message-entity (mime-parse-buffer))
- (setq flags (or (elmo-message-flags folder msg)
- (and (elmo-message-entity folder msg)
- '(read))))
+ (setq flags (elmo-message-flags
+ folder
+ msg
+ (elmo-msgdb-get-message-id-from-buffer)))
(catch 'terminate
(dolist (rule (append elmo-split-rule default-rule))
(setq elmo-split-match-string-internal nil)
(luna-define-generic elmo-message-file-p (folder number)
"Return t if message in the FOLDER with NUMBER is a file.")
-(luna-define-generic elmo-message-flags (folder number)
+(luna-define-generic elmo-message-flags (folder number &optional msgid)
"Return a list of flags.
FOLDER is a ELMO folder structure.
-NUMBER is a number of the message.")
-
-(luna-define-method elmo-message-flags ((folder elmo-folder) number)
- (elmo-msgdb-flags (elmo-folder-msgdb folder) number))
+NUMBER is a number of the message.
+If optional argument MSGID is specified,
+the message with NUMBER checks whether it has MSGID.")
+
+(luna-define-method elmo-message-flags ((folder elmo-folder) number
+ &optional msgid)
+ (if msgid
+ (let ((this-id (elmo-message-field folder number 'message-id)))
+ (and this-id
+ (string= this-id msgid)
+ (or (elmo-msgdb-flags (elmo-folder-msgdb folder) number)
+ '(read))))
+ (elmo-msgdb-flags (elmo-folder-msgdb folder) number)))
(defsubst elmo-message-flagged-p (folder number flag)
"Return non-nil if the message is set FLAG.
(defun elmo-generic-folder-append-messages (folder src-folder numbers
same-number)
(let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder))))
- unseen table flags
+ unseen table
succeed-numbers failure cache id)
(setq table (elmo-folder-flag-table folder))
(with-temp-buffer
(setq failure nil
id (and src-msgdb-exists
(elmo-message-field src-folder (car numbers)
- 'message-id))
- flags (or (elmo-message-flags src-folder (car numbers))
- (and id '(read))))
+ 'message-id)))
(condition-case nil
(setq cache (elmo-file-cache-get id)
failure
(> (buffer-size) 0)
(elmo-folder-append-buffer
folder
- flags
+ (elmo-message-flags
+ src-folder
+ (car numbers)
+ (elmo-msgdb-get-message-id-from-buffer))
(if same-number (car numbers))))))
(error (setq failure t)))
;; FETCH & APPEND finished