* elmo-msgdb.el (elmo-msgdb-seen-list): Use `elmo-msgdb-unread-marks'
authorteranisi <teranisi>
Mon, 16 Sep 2002 08:10:44 +0000 (08:10 +0000)
committerteranisi <teranisi>
Mon, 16 Sep 2002 08:10:44 +0000 (08:10 +0000)
* elmo-imap4.el (elmo-imap4-fetch-callback-1-subr): Set answered mark.
(elmo-imap4-folder-list-any-plugged): New function.
(elmo-imap4-search-internal-primitive): Use it.

* elmo-filter.el (elmo-folder-check): Synchronize original folder
only when require-msgdb slot is non-nil.
(elmo-folder-close): Clear target folder's msgdb.

elmo/ChangeLog
elmo/elmo-filter.el
elmo/elmo-imap4.el
elmo/elmo-msgdb.el

index b511394..47c7776 100644 (file)
@@ -1,3 +1,15 @@
+2002-09-16  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-msgdb.el (elmo-msgdb-seen-list): Use `elmo-msgdb-unread-marks'
+
+       * elmo-imap4.el (elmo-imap4-fetch-callback-1-subr): Set answered mark.
+       (elmo-imap4-folder-list-any-plugged): New function.
+       (elmo-imap4-search-internal-primitive): Use it.
+
+       * elmo-filter.el (elmo-folder-check): Synchronize original folder
+       only when require-msgdb slot is non-nil.
+       (elmo-folder-close): Clear target folder's msgdb.
+
 2002-09-13  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo-pop3.el (elmo-folder-msgdb-create): Follow the API change.
index 4698329..d626e30 100644 (file)
   (luna-call-next-method))
 
 (luna-define-method elmo-folder-check ((folder elmo-filter-folder))
-  (elmo-folder-synchronize (elmo-filter-folder-target-internal folder)))
+  (if (elmo-filter-folder-require-msgdb-internal folder)
+      (elmo-folder-synchronize (elmo-filter-folder-target-internal folder))))
 
 (luna-define-method elmo-folder-close-internal ((folder elmo-filter-folder))
   (elmo-folder-close-internal (elmo-filter-folder-target-internal folder)))
 
-(luna-define-method elmo-folder-close :around ((folder elmo-filter-folder))
-  ;; Save target msgdb if it is used.
+(luna-define-method elmo-folder-close :after ((folder elmo-filter-folder))
+  ;; Clear target msgdb if it is used.
   (if (elmo-filter-folder-require-msgdb-internal folder)
-      (elmo-folder-close (elmo-filter-folder-target-internal folder)))
-  (luna-call-next-method))
+      (elmo-folder-set-msgdb-internal (elmo-filter-folder-target-internal
+                                      folder) nil)))
 
 (luna-define-method elmo-folder-commit :around ((folder elmo-filter-folder))
   ;; Save target msgdb if it is used.
index b4279f1..7b51c92 100644 (file)
@@ -810,17 +810,22 @@ If CHOP-LENGTH is not specified, message set is not chopped."
                 elmo-imap4-seen-messages)))
       (setq mark (or (if (elmo-file-cache-status
                          (elmo-file-cache-get (car entity)))
+                        ;; cached.
+                        (if (member "\\Answered" flags)
+                            elmo-msgdb-answered-cached-mark
+                          (if (or seen
+                                  (and use-flag
+                                       (member "\\Seen" flags)))
+                              nil
+                            elmo-msgdb-unread-cached-mark))
+                      (if (member "\\Answered" flags)
+                          elmo-msgdb-answered-uncached-mark
                         (if (or seen
                                 (and use-flag
                                      (member "\\Seen" flags)))
-                            nil
-                          elmo-msgdb-unread-cached-mark)
-                      (if (or seen
-                              (and use-flag
-                                   (member "\\Seen" flags)))
-                          (if elmo-imap4-use-cache
-                              elmo-msgdb-read-uncached-mark)
-                        elmo-msgdb-new-mark)))))
+                            (if elmo-imap4-use-cache
+                                elmo-msgdb-read-uncached-mark)
+                          elmo-msgdb-new-mark))))))
     (setq elmo-imap4-current-msgdb
          (elmo-msgdb-append
           elmo-imap4-current-msgdb
@@ -1884,6 +1889,9 @@ Return nil if no complete line has arrived."
   ((folder elmo-imap4-folder))
   (elmo-imap4-list folder "answered"))
 
+(defun elmo-imap4-folder-list-any-plugged (folder)
+  (elmo-imap4-list folder "or answered or unseen flagged"))
+
 (luna-define-method elmo-folder-use-flag-p ((folder elmo-imap4-folder))
   (not (string-match elmo-imap4-disuse-server-flag-mailbox-regexp
                     (elmo-imap4-folder-mailbox-internal folder))))
@@ -2122,7 +2130,9 @@ If optional argument REMOVE is non-nil, remove FLAG."
        ((string= "important" (elmo-filter-value filter))
        (elmo-folder-list-importants folder))
        ((string= "answered" (elmo-filter-value filter))
-       (elmo-folder-list-answereds folder))))
+       (elmo-folder-list-answereds folder))
+       ((string= "any" (elmo-filter-value filter))
+       (elmo-imap4-folder-list-any-plugged folder))))
      ((or (string= "since" search-key)
          (string= "before" search-key))
       (setq search-key (concat "sent" search-key)
index 32203ea..5a46850 100644 (file)
@@ -453,8 +453,8 @@ content of MSGDB is changed."
       (if (setq mark (elmo-msgdb-get-mark
                      msgdb
                      (elmo-msgdb-overview-entity-get-number (car ov))))
-         (if (and mark (member mark (list elmo-msgdb-important-mark
-                                          elmo-msgdb-read-uncached-mark)))
+         (if (and mark (not (member mark
+                                    (elmo-msgdb-unread-marks))))
              (setq seen-list (cons
                               (elmo-msgdb-overview-entity-get-id (car ov))
                               seen-list)))