* elmo-imap4.el (elmo-imap4-seen-messages): New buffer local variable.
authorteranisi <teranisi>
Wed, 3 Oct 2001 08:40:11 +0000 (08:40 +0000)
committerteranisi <teranisi>
Wed, 3 Oct 2001 08:40:11 +0000 (08:40 +0000)
(elmo-imap4-fetch-callback-1-subr): Save important message numbers to
elmo-imap4-seen-messages.
(elmo-folder-msgdb-create-plugged): Initialize elmo-imap4-seen-messages;
Set seen mark on elmo-imap4-seen-messages.

elmo/ChangeLog
elmo/elmo-imap4.el

index b242ef9..8b0dd0d 100644 (file)
@@ -1,5 +1,12 @@
 2001-10-03  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * elmo-imap4.el (elmo-imap4-seen-messages): New buffer local variable.
+       (elmo-imap4-fetch-callback-1-subr): Save important message numbers to
+       elmo-imap4-seen-messages.
+       (elmo-folder-msgdb-create-plugged): Initialize
+       elmo-imap4-seen-messages;
+       Set seen mark on elmo-imap4-seen-messages.
+
        * elmo-pipe.el (elmo-folder-message-file-p): Define.
 
        * elmo.el (elmo-generic-folder-append-messages): Check return value of
index c8337c9..3bdc212 100644 (file)
 
 ;;; XXX Temporal implementation
 (defvar elmo-imap4-current-msgdb nil)
+(defvar elmo-imap4-seen-messages nil)
 
 (defvar elmo-imap4-local-variables
   '(elmo-imap4-status
     elmo-imap4-fetch-callback-data
     elmo-imap4-status-callback
     elmo-imap4-status-callback-data
-    elmo-imap4-current-msgdb))
+    elmo-imap4-current-msgdb
+    elmo-imap4-seen-messages))
 
 ;;;;
 
@@ -766,20 +768,25 @@ If CHOP-LENGTH is not specified, message set is not chopped."
         mark)
     (if (member "\\Flagged" flags)
        (elmo-msgdb-global-mark-set (car entity) (nth 3 app-data)))
-    (setq mark (or (elmo-msgdb-global-mark-get (car entity))
-                  (if (elmo-file-cache-status
-                       (elmo-file-cache-get (car entity)))
+    (if (setq mark (elmo-msgdb-global-mark-get (car entity)))
+       (unless (member "\\Seen" flags)
+         (setq elmo-imap4-seen-messages
+               (cons
+                (elmo-msgdb-overview-entity-get-number entity)
+                elmo-imap4-seen-messages)))
+      (setq mark (or (if (elmo-file-cache-status
+                         (elmo-file-cache-get (car entity)))
+                        (if (or seen
+                                (and use-flag
+                                     (member "\\Seen" flags)))
+                            nil
+                          (nth 1 app-data))
                       (if (or seen
                               (and use-flag
                                    (member "\\Seen" flags)))
-                          nil
-                        (nth 1 app-data))
-                    (if (or seen
-                            (and use-flag
-                                 (member "\\Seen" flags)))
-                        (if elmo-imap4-use-cache
-                            (nth 2 app-data))
-                      (nth 0 app-data)))))
+                          (if elmo-imap4-use-cache
+                              (nth 2 app-data))
+                        (nth 0 app-data))))))
     (setq elmo-imap4-current-msgdb
          (elmo-msgdb-append
           elmo-imap4-current-msgdb
@@ -2176,6 +2183,7 @@ If optional argument REMOVE is non-nil, remove FLAG."
       ;; Setup callback.
       (with-current-buffer (elmo-network-session-buffer session)
        (setq elmo-imap4-current-msgdb nil
+             elmo-imap4-seen-messages nil
              elmo-imap4-fetch-callback 'elmo-imap4-fetch-callback-1
              elmo-imap4-fetch-callback-data (cons args
                                                   (elmo-folder-use-flag-p
@@ -2197,6 +2205,8 @@ If optional argument REMOVE is non-nil, remove FLAG."
             (/ (* total 100) length)))
          (setq set-list (cdr set-list)))
        (message "Getting overview...done")
+       (when elmo-imap4-seen-messages
+         (elmo-imap4-set-flag folder elmo-imap4-seen-messages "\\Seen"))
        elmo-imap4-current-msgdb))))
 
 (luna-define-method elmo-folder-unmark-important-plugged