mark nor message-id when msgdb of source folder is not loaded.
* elmo.el (elmo-generic-folder-append-messages): Ditto.
* elmo-maildir.el (elmo-folder-append-messages): Ditto.
+2003-07-30 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-localdir.el (elmo-folder-append-messages): Don't refer
+ mark nor message-id when msgdb of source folder is not loaded.
+
+ * elmo.el (elmo-generic-folder-append-messages): Ditto.
+
+ * elmo-maildir.el (elmo-folder-append-messages): Ditto.
+
2003-07-29 Yuuichi Teranishi <teranisi@gohome.org>
* elmo.el (elmo-folder-length): Don't require msgdb.
((folder elmo-localdir-folder)
src-folder numbers &optional same-number)
(if (elmo-folder-message-file-p src-folder)
- (let ((dir (elmo-localdir-folder-directory-internal folder))
+ (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder))))
+ (dir (elmo-localdir-folder-directory-internal folder))
(table (elmo-flag-table-load (elmo-folder-msgdb-path folder)))
(succeeds numbers)
(next-num (1+ (car (elmo-folder-status folder))))
mark flag id)
(while numbers
- (setq mark (elmo-message-mark src-folder (car numbers))
+ (setq mark (and src-msgdb-exists
+ (elmo-message-mark src-folder (car numbers)))
flag (cond
((null mark) 'read)
((member mark (elmo-msgdb-answered-marks))
(int-to-string
(if same-number (car numbers) next-num))
dir))
- ;; src folder's msgdb is loaded.
- (when (setq id (elmo-message-field src-folder (car numbers)
- 'message-id))
+ ;; save flag-table only when src folder's msgdb is loaded.
+ (when (setq id (and src-msgdb-exists
+ (elmo-message-field src-folder (car numbers)
+ 'message-id)))
(elmo-flag-table-set table id flag))
(elmo-progress-notify 'elmo-folder-move-messages)
(if (and (setq numbers (cdr numbers))
((folder elmo-maildir-folder)
src-folder numbers &optional same-number)
(if (elmo-folder-message-file-p src-folder)
- (let ((dir (elmo-maildir-folder-directory-internal folder))
+ (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder))))
+ (dir (elmo-maildir-folder-directory-internal folder))
(table (elmo-flag-table-load (elmo-folder-msgdb-path folder)))
(succeeds numbers)
filename mark flag id)
(dolist (number numbers)
- (setq mark (elmo-message-mark src-folder (car numbers))
+ (setq mark (and src-msgdb-exists
+ (elmo-message-mark src-folder (car numbers)))
flag (cond
((null mark) 'read)
((member mark (elmo-msgdb-answered-marks))
(concat "new/" (file-name-nondirectory filename))
dir))
;; src folder's msgdb is loaded.
- (when (setq id (elmo-message-field src-folder (car numbers)
- 'message-id))
+ (when (setq id (and src-msgdb-exists
+ (elmo-message-field src-folder (car numbers)
+ 'message-id)))
(elmo-flag-table-set table id flag))
(elmo-progress-notify 'elmo-folder-move-messages))
(when (elmo-folder-persistent-p folder)
msgs len)
(message "Checking %s..." (elmo-folder-name-internal src))
;; Warnnig: some function requires msgdb
- ;; but elmo-folder-open-internal do not load msgdb.
+ ;; but elmo-folder-open-internal do not load msgdb.
(elmo-folder-open-internal src)
(setq msgs (elmo-pipe-folder-list-target-messages src ignore-list)
len (length msgs))
(defun elmo-generic-folder-append-messages (folder src-folder numbers
same-number)
- (let (unseen table flag mark
- succeed-numbers failure cache id)
+ (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder))))
+ unseen table flag mark
+ succeed-numbers failure cache id)
(setq table (elmo-flag-table-load (elmo-folder-msgdb-path folder)))
(with-temp-buffer
(set-buffer-multibyte nil)
(while numbers
(setq failure nil
- id (elmo-message-field src-folder (car numbers) 'message-id)
- mark (elmo-message-mark src-folder (car numbers))
+ id (and src-msgdb-exists
+ (elmo-message-field src-folder (car numbers)
+ 'message-id))
+ mark (and src-msgdb-exists
+ (elmo-message-mark src-folder (car numbers)))
flag (and id
(cond
((null mark) 'read)