* elmo-filter.el (elmo-folder-msgdb-create): Call target-folder's
authorteranisi <teranisi>
Mon, 16 Sep 2002 11:41:16 +0000 (11:41 +0000)
committerteranisi <teranisi>
Mon, 16 Sep 2002 11:41:16 +0000 (11:41 +0000)
method if msgdb is not required.

elmo/ChangeLog
elmo/elmo-filter.el

index 47c7776..c48d0af 100644 (file)
@@ -1,5 +1,8 @@
 2002-09-16  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * elmo-filter.el (elmo-folder-msgdb-create): Call target-folder's
+       method if msgdb is not required.
+
        * elmo-msgdb.el (elmo-msgdb-seen-list): Use `elmo-msgdb-unread-marks'
 
        * elmo-imap4.el (elmo-imap4-fetch-callback-1-subr): Set answered mark.
index d626e30..7f0ca91 100644 (file)
 
 (luna-define-method elmo-folder-msgdb-create ((folder elmo-filter-folder)
                                              numlist seen-list)
-  (let* ((target-folder (elmo-filter-folder-target-internal folder))
-        (len (length numlist))
-        (msgdb (elmo-folder-msgdb target-folder))
-        overview number-alist mark-alist message-id entity)
-    (when (> len elmo-display-progress-threshold)
-      (elmo-progress-set 'elmo-folder-msgdb-create
-                        len "Creating msgdb..."))
-    (unwind-protect
-       (dolist (number numlist)
-         (setq entity (elmo-msgdb-overview-get-entity number msgdb))
-         (when entity
-           (setq overview (elmo-msgdb-append-element overview entity)
-                 message-id (elmo-msgdb-overview-entity-get-id entity)
-                 number-alist (elmo-msgdb-number-add number-alist
-                                                     number
-                                                     message-id)
-                 mark-alist (elmo-msgdb-mark-append
-                             mark-alist
-                             number
-                             (elmo-msgdb-get-mark msgdb number))))
-         (elmo-progress-notify 'elmo-folder-msgdb-create))
-      (elmo-progress-clear 'elmo-folder-msgdb-create))
-    (list overview number-alist mark-alist)))
+  (if (elmo-filter-folder-require-msgdb-internal folder)
+      (let* ((target-folder (elmo-filter-folder-target-internal folder))
+            (len (length numlist))
+            (msgdb (elmo-folder-msgdb target-folder))
+            overview number-alist mark-alist message-id entity)
+       (when (> len elmo-display-progress-threshold)
+         (elmo-progress-set 'elmo-folder-msgdb-create
+                            len "Creating msgdb..."))
+       (unwind-protect
+           (dolist (number numlist)
+             (setq entity (elmo-msgdb-overview-get-entity number msgdb))
+             (when entity
+               (setq overview (elmo-msgdb-append-element overview entity)
+                     message-id (elmo-msgdb-overview-entity-get-id entity)
+                     number-alist (elmo-msgdb-number-add number-alist
+                                                         number
+                                                         message-id)
+                     mark-alist (elmo-msgdb-mark-append
+                                 mark-alist
+                                 number
+                                 (elmo-msgdb-get-mark msgdb number))))
+             (elmo-progress-notify 'elmo-folder-msgdb-create))
+         (elmo-progress-clear 'elmo-folder-msgdb-create))
+       (list overview number-alist mark-alist))
+    ;; Does not require msgdb.
+    (elmo-folder-msgdb-create
+     (elmo-filter-folder-target-internal folder)
+     numlist seen-list)))
 
 (luna-define-method elmo-folder-append-buffer ((folder elmo-filter-folder)
                                               unread &optional number)