* elmo-sendlog.el (elmo-folder-delete-messages): Added.
authorokada <okada>
Sat, 1 Dec 2001 20:54:36 +0000 (20:54 +0000)
committerokada <okada>
Sat, 1 Dec 2001 20:54:36 +0000 (20:54 +0000)
        (elmo-map-message-fetch): Fix.
        * elmo-map.el (elmo-folder-status): Fix for killed.

elmo/ChangeLog
elmo/elmo-map.el
elmo/elmo-nntp.el
elmo/elmo-sendlog.el

index 2663190..606b57e 100644 (file)
@@ -1,5 +1,11 @@
 2001-12-02  Kenichi OKADA  <okada@opaopa.org>
 
+       * elmo-sendlog.el (elmo-folder-delete-messages): Added.
+       (elmo-map-message-fetch): Fix.
+       * elmo-map.el (elmo-folder-status): Fix for killed.
+
+2001-12-02  Kenichi OKADA  <okada@opaopa.org>
+
        * elmo-sendlog.el: New file.
        * elmo-internal.el (elmo-internal-folder-list): Added 'sendlog.
 
index 8b0656d..6391cf4 100644 (file)
 
 (luna-define-method elmo-folder-status ((folder elmo-map-folder))
   (elmo-folder-open-internal folder)
-  (prog1
-      (let ((numbers (mapcar
-                     'car
-                     (elmo-map-folder-location-alist-internal folder))))
+  (elmo-folder-set-killed-list-internal
+   folder
+   (elmo-msgdb-killed-list-load (elmo-folder-msgdb-path folder)))
+  (let ((numbers (mapcar
+                 'car
+                 (elmo-map-folder-location-alist-internal folder))))
+    (setq numbers (elmo-living-messages numbers (elmo-folder-killed-list-internal folder)))
+    (prog1
        (cons (elmo-max-of-list numbers)
-             (length numbers)))
-    ;; Don't close after status.
-    (unless (elmo-folder-reserve-status-p folder)
-      (elmo-folder-close-internal folder))))
+             (length numbers))
+      ;; Don't close after status.
+      (unless (elmo-folder-reserve-status-p folder)
+       (elmo-folder-close-internal folder)))))
 
 (defun elmo-map-message-number (folder location)
   "Return number of the message in the FOLDER with LOCATION."
index b210779..27e8e22 100644 (file)
@@ -638,7 +638,7 @@ Don't cache if nil.")
                   elmo-newsgroups-hashtb))
            (progn
              (setq end-num (nth 2 entry))
-             (when(and  killed-list
+             (when (and killed-list
                         (elmo-number-set-member end-num killed-list))
                ;; Max is killed.
                (setq end-num nil))
index 6a41196..c92fb8b 100644 (file)
            (elmo-msgdb-create-overview-entity-from-file
             (car numbers) (elmo-message-file-name folder (car numbers))))
       (if (null entity)
-         ()
+         (elmo-folder-set-killed-list-internal
+          folder
+          (nconc
+           (elmo-folder-killed-list-internal folder)
+           (list (car numbers))))
        (setq num (elmo-msgdb-overview-entity-get-number entity))
        (setq overview
              (elmo-msgdb-append-element
 (luna-define-method elmo-map-message-fetch ((folder elmo-sendlog-folder)
                                            location strategy
                                            &optional section unseen)
-  (insert-file-contents-as-binary 
-   (elmo-file-cache-get-path location)))
+  (let ((filename (elmo-file-cache-get-path location)))
+    (if (file-exists-p filename)
+       (insert-file-contents-as-binary filename)
+      (error "Now this message is not cached. Please s all"))))
 
 (luna-define-method elmo-folder-creatable-p ((folder elmo-sendlog-folder))
   nil)
 (luna-define-method elmo-folder-exists-p ((folder elmo-sendlog-folder))
   t)
 
+(luna-define-method elmo-folder-delete-messages ((folder elmo-sendlog-folder)
+                                                numbers)
+  (let ((killed-list (elmo-folder-killed-list-internal folder)))
+    (dolist (number numbers)
+      (setq killed-list
+           (elmo-msgdb-set-as-killed killed-list number)))
+    (elmo-folder-set-killed-list-internal folder killed-list))
+  t)
+
 (luna-define-method elmo-folder-search ((folder elmo-sendlog-folder)
                                        condition &optional from-msgs)
   (let* ((msgs (or from-msgs (elmo-folder-list-messages folder)))