* elmo-imap4.el (elmo-imap4-msgdb-create): Set `elmo-imap4-fetch-callback-data'
authorteranisi <teranisi>
Tue, 26 Dec 2000 05:49:05 +0000 (05:49 +0000)
committerteranisi <teranisi>
Tue, 26 Dec 2000 05:49:05 +0000 (05:49 +0000)
 as a cons cell of `args' and result of `elmo-imap4-use-flag-p'.
(elmo-imap4-fetch-callback-1): Set mark according to the result of
 `elmo-imap4-use-flag-p'.

elmo/ChangeLog
elmo/elmo-imap4.el

index 917fe49..e72dbe6 100644 (file)
@@ -1,3 +1,11 @@
+2000-12-26  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-imap4.el (elmo-imap4-msgdb-create): Set
+       `elmo-imap4-fetch-callback-data' as a cons cell of `args'
+       and result of `elmo-imap4-use-flag-p'.
+       (elmo-imap4-fetch-callback-1): Set mark according to
+       the result of `elmo-imap4-use-flag-p'.
+
 2000-12-22  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo-msgdb.el (elmo-generic-folder-diff): Moved from elmo2.el
index a02f91a..24a290b 100644 (file)
@@ -1040,20 +1040,28 @@ If optional argument UNMARK is non-nil, unmark."
 
 ;;
 ;; app-data:
+;; cons of list
 ;; 0: new-mark 1: already-mark 2: seen-mark 3: important-mark
-;; 4: seen-list 5: as-number
+;; 4: seen-list
+;; and result of use-flag-p.
 (defun elmo-imap4-fetch-callback-1 (entity flags app-data)
   "A msgdb entity callback function."
-  (let ((seen (member (car entity) (nth 4 app-data)))
-       mark)
+  (let* ((use-flag (cdr app-data))
+        (app-data (car app-data))
+        (seen (member (car entity) (nth 4 app-data)))
+        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-cache-exists-p (car entity)) ;; XXX
-                      (if (or (member "\\Seen" flags) seen)
+                      (if (or seen
+                              (and use-flag
+                                   (member "\\Seen" flags)))
                           nil
                         (nth 1 app-data))
-                    (if (or (member "\\Seen" flags) seen)
+                    (if (or seen
+                            (and use-flag
+                                 (member "\\Seen" flags)))
                         (if elmo-imap4-use-cache
                             (nth 2 app-data))
                       (nth 0 app-data)))))
@@ -1093,7 +1101,9 @@ If optional argument UNMARK is non-nil, unmark."
       (with-current-buffer (elmo-network-session-buffer session)
        (setq elmo-imap4-current-msgdb nil
              elmo-imap4-fetch-callback 'elmo-imap4-fetch-callback-1
-             elmo-imap4-fetch-callback-data args)
+             elmo-imap4-fetch-callback-data (cons args
+                                                  (elmo-imap4-use-flag-p
+                                                   spec)))
        (while set-list
          (elmo-imap4-send-command-wait
           session