* elmo-shimbun.el (elmo-shimbun-folder): Added `header-hash' slot.
authorteranisi <teranisi>
Thu, 5 Apr 2001 03:31:47 +0000 (03:31 +0000)
committerteranisi <teranisi>
Thu, 5 Apr 2001 03:31:47 +0000 (03:31 +0000)
(elmo-folder-open-internal): Setup `header-hash' slot.
(elmo-shimbun-msgdb-create-entity): Use `header-hash' to get header
information.
(elmo-map-message-fetch): Ditto.

elmo/ChangeLog
elmo/elmo-shimbun.el

index 34b4224..57cca10 100644 (file)
@@ -1,3 +1,11 @@
+2001-04-05  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-shimbun.el (elmo-shimbun-folder): Added `header-hash' slot.
+       (elmo-folder-open-internal): Setup `header-hash' slot.
+       (elmo-shimbun-msgdb-create-entity): Use `header-hash' to get header
+       information.
+       (elmo-map-message-fetch): Ditto.
+
 2001-04-04  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * shimbun.el, sb-airs.el, sb-asahi.el, sb-bbdb-ml.el, sb-cnet.el,
index 4205907..424a254 100644 (file)
@@ -34,7 +34,7 @@
 
 (eval-and-compile
   (luna-define-class elmo-shimbun-folder
-                    (elmo-map-folder) (shimbun group))
+                    (elmo-map-folder) (shimbun header-hash group))
   (luna-define-internal-accessors 'elmo-shimbun-folder))
 
 (luna-define-method elmo-folder-initialize ((folder
                                                        elmo-shimbun-folder))
   (shimbun-open-group
    (elmo-shimbun-folder-shimbun-internal folder)
-   (elmo-shimbun-folder-group-internal folder)))
+   (elmo-shimbun-folder-group-internal folder))
+  (elmo-shimbun-folder-set-header-hash-internal
+   folder
+   (elmo-make-hash (length (shimbun-headers
+                           (elmo-shimbun-folder-shimbun-internal folder)))))
+  ;; Set up header hash.
+  (dolist (header (shimbun-headers (elmo-shimbun-folder-shimbun-internal
+                                   folder)))
+    (elmo-set-hash-val
+     (shimbun-header-id header) header
+     (elmo-shimbun-folder-header-hash-internal folder))))
 
 (luna-define-method elmo-folder-close-internal :after ((folder
-                                                      elmo-shimbun-folder))
+                                                       elmo-shimbun-folder))
   (shimbun-close-group
-   (elmo-shimbun-folder-shimbun-internal folder)))
+   (elmo-shimbun-folder-shimbun-internal folder))
+  (elmo-shimbun-folder-set-header-hash-internal
+   folder nil))
 
 (luna-define-method elmo-folder-check :after ((folder elmo-shimbun-folder))
   (shimbun-close-group
@@ -81,9 +93,9 @@
 (defun elmo-shimbun-msgdb-create-entity (folder number)
   (with-temp-buffer
     (shimbun-header-insert
-     (shimbun-header
-      (elmo-shimbun-folder-shimbun-internal folder)
-      (elmo-map-message-location folder number)))
+     (elmo-get-hash-val
+      (elmo-map-message-location folder number)
+      (elmo-shimbun-folder-header-hash-internal folder)))
     (elmo-msgdb-create-overview-from-buffer number)))
 
 (luna-define-method elmo-folder-msgdb-create ((folder elmo-shimbun-folder)
       (with-current-buffer outbuf
        (erase-buffer)
        (shimbun-article (elmo-shimbun-folder-shimbun-internal folder)
-                        location)
+                        (elmo-get-hash-val
+                         location
+                         (elmo-shimbun-folder-header-hash-internal folder)))
        t)
     (with-temp-buffer
       (shimbun-article (elmo-shimbun-folder-shimbun-internal folder)
-                        location)
+                      (elmo-get-hash-val
+                       location
+                       (elmo-shimbun-folder-header-hash-internal folder)))
       (buffer-string))))
 
 (luna-define-method elmo-map-folder-list-message-locations