* elmo.el (elmo-message-set-cached): Define as a method.
authorteranisi <teranisi>
Fri, 1 Aug 2003 17:17:13 +0000 (17:17 +0000)
committerteranisi <teranisi>
Fri, 1 Aug 2003 17:17:13 +0000 (17:17 +0000)
* elmo-pipe.el (elmo-message-set-cached): Define.
(elmo-find-fetch-strategy): Ditto.

* elmo-multi.el (elmo-message-set-cached): Define.
(elmo-find-fetch-strategy): Rewrite.

* elmo-mime.el (elmo-mime-message-display): Use elmo-message-entity.

elmo/ChangeLog
elmo/elmo-mime.el
elmo/elmo-multi.el
elmo/elmo-pipe.el
elmo/elmo.el

index 0156e42..c819cd0 100644 (file)
@@ -1,5 +1,15 @@
 2003-08-01  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * elmo.el (elmo-message-set-cached): Define as a method.
+
+       * elmo-pipe.el (elmo-message-set-cached): Define.
+       (elmo-find-fetch-strategy): Ditto.
+
+       * elmo-multi.el (elmo-message-set-cached): Define.
+       (elmo-find-fetch-strategy): Rewrite.
+
+       * elmo-mime.el (elmo-mime-message-display): Use elmo-message-entity.
+
        * elmo-pipe.el (elmo-message-folder): Fixed definition.
 
 2003-07-30  Yuuichi Teranishi  <teranisi@gohome.org>
index 9efb463..feb5f42 100644 (file)
@@ -224,9 +224,7 @@ Return non-nil if not entire message was fetched."
   (let (mime-display-header-hook ; Do nothing.
        (elmo-message-displaying t)
        entity strategy)
-    (setq entity (elmo-msgdb-overview-get-entity number
-                                                (elmo-folder-msgdb
-                                                 folder)))
+    (setq entity (elmo-message-entity folder number))
     (setq strategy (elmo-find-fetch-strategy folder entity
                                             ignore-cache))
     (mime-display-message
index 55a6caf..479c474 100644 (file)
   (nth (- (/ number (elmo-multi-folder-divide-number-internal folder)) 1)
        (elmo-multi-folder-children-internal folder)))
 
+(luna-define-method elmo-message-set-cached ((folder elmo-multi-folder)
+                                            number cached)
+  (let ((pair (elmo-multi-real-folder-number folder number)))
+    (elmo-message-set-cached (car pair) (cdr pair) cached)))
+
+(luna-define-method elmo-find-fetch-strategy
+  ((folder elmo-multi-folder) entity &optional ignore-cache)
+  (let ((pair (elmo-multi-real-folder-number
+              folder
+              (elmo-message-entity-number entity))))
+    (elmo-find-fetch-strategy
+     (car pair)
+     (elmo-message-entity (car pair) (cdr pair)) ignore-cache)))
+
 (luna-define-method elmo-message-entity ((folder elmo-multi-folder) key)
   (cond
    ((numberp key)
   (dolist (child (elmo-multi-folder-children-internal folder))
     (elmo-folder-process-crosspost child)))
 
-(defsubst elmo-multi-find-fetch-strategy (folder entity ignore-cache)
-  (if entity
-      (let ((pair (elmo-multi-real-folder-number
-                  folder
-                  (elmo-msgdb-overview-entity-get-number entity)))
-           (new-entity (elmo-msgdb-copy-overview-entity entity)))
-       (setq new-entity
-             (elmo-msgdb-overview-entity-set-number new-entity (cdr pair)))
-       (elmo-find-fetch-strategy (car pair) new-entity ignore-cache))
-    (elmo-make-fetch-strategy 'entire)))
-
-(luna-define-method elmo-find-fetch-strategy
-  ((folder elmo-multi-folder)
-   entity &optional ignore-cache)
-  (elmo-multi-find-fetch-strategy folder entity ignore-cache))
-
 (luna-define-method elmo-message-fetch ((folder elmo-multi-folder)
                                        number strategy
                                        &optional section outbuf unseen)
index 987fd44..3f85eb6 100644 (file)
                      number
                      field))
 
+(luna-define-method elmo-message-set-cached ((folder elmo-pipe-folder)
+                                            number cached)
+  (elmo-message-set-cached (elmo-pipe-folder-dst-internal folder)
+                          number cached))
+
+(luna-define-method elmo-find-fetch-strategy
+  ((folder elmo-pipe-folder) entity &optional ignore-cache)
+  (elmo-find-fetch-strategy (elmo-pipe-folder-dst-internal folder)
+                           (elmo-message-entity
+                            (elmo-pipe-folder-dst-internal folder)
+                            (elmo-message-entity-number entity))
+                           ignore-cache))
+
 (luna-define-method elmo-message-entity ((folder elmo-pipe-folder) key)
   (elmo-message-entity (elmo-pipe-folder-dst-internal folder) key))
 
index 13e6cc5..eebaa03 100644 (file)
@@ -1137,11 +1137,14 @@ Return non-nil when message is accessible."
       (elmo-folder-local-p folder)
       (elmo-msgdb-get-cached (elmo-folder-msgdb folder) number)))
 
-(defun elmo-message-set-cached (folder number cached)
+(luna-define-generic elmo-message-set-cached (folder number cached)
   "Set cache status of the message in the msgdb.
 FOLDER is the ELMO folder structure.
 NUMBER is a number of the message.
-If CACHED is t, message is set as cached."
+If CACHED is t, message is set as cached.")
+
+(luna-define-method elmo-message-set-cached ((folder elmo-folder)
+                                            number cached)
   (when (elmo-msgdb-set-cached (elmo-folder-msgdb folder)
                               number
                               cached