Changed codename to Venus-pre2.
[elisp/wanderlust.git] / elmo / elmo-pop3.el
index cb59583..ae25a19 100644 (file)
@@ -161,16 +161,26 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
     (delete-process (elmo-network-session-process-internal session))))
 
 (defun elmo-pop3-get-session (folder &optional if-exists)
+  "Get POP3 session for FOLDER.
+If IF-EXISTS is non-nil, don't get new session.
+If IF-EXISTS is `any-exists', get BIFF session or normal session if exists."
   (let ((elmo-pop3-use-uidl-internal (if elmo-inhibit-number-mapping
                                         nil
                                       (elmo-pop3-folder-use-uidl-internal
                                        folder))))
-    (elmo-network-get-session 'elmo-pop3-session
-                             (concat
-                              (if (elmo-folder-biff-internal folder)
-                                  "BIFF-")
-                              "POP3")
-                             folder if-exists)))
+    (if (eq if-exists 'any-exists)
+       (or (elmo-network-get-session 'elmo-pop3-session
+                                     "POP3"
+                                     folder if-exists)
+           (elmo-network-get-session 'elmo-pop3-session
+                                     "BIFF-POP3"
+                                     folder if-exists))
+      (elmo-network-get-session 'elmo-pop3-session
+                               (concat
+                                (if (elmo-folder-biff-internal folder)
+                                    "BIFF-")
+                                "POP3")
+                               folder if-exists))))
 
 (defun elmo-pop3-send-command (process command &optional no-erase no-log)
   (with-current-buffer (process-buffer process)
@@ -666,7 +676,9 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
       (copy-to-buffer tobuffer (point-min) (point-max)))))
 
 (luna-define-method elmo-folder-msgdb-create ((folder elmo-pop3-folder)
-                                             numlist seen-list)
+                                             numlist new-mark
+                                             already-mark seen-mark
+                                             important-mark seen-list)
   (let ((process (elmo-network-session-process-internal
                  (elmo-pop3-get-session folder))))
     (with-current-buffer (process-buffer process)
@@ -675,7 +687,8 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
        (elmo-pop3-msgdb-create-by-header
        process
        numlist
-       seen-list
+       new-mark already-mark
+       seen-mark seen-list
        (if (elmo-pop3-folder-use-uidl-internal folder)
            (elmo-pop3-folder-location-alist-internal folder)))))))
 
@@ -713,6 +726,8 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
                     elmo-pop3-size-hash))
 
 (defun elmo-pop3-msgdb-create-by-header (process numlist
+                                                new-mark already-mark
+                                                seen-mark
                                                 seen-list
                                                 loc-alist)
   (let ((tmp-buffer (get-buffer-create " *ELMO Overview TMP*")))
@@ -733,13 +748,14 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
           process
           (length numlist)
           numlist
-          seen-list loc-alist)
+          new-mark already-mark seen-mark seen-list loc-alist)
        (kill-buffer tmp-buffer)))))
 
 (defun elmo-pop3-msgdb-create-message (buffer
                                       process
                                       num
-                                      numlist
+                                      numlist new-mark already-mark
+                                      seen-mark
                                       seen-list
                                       loc-alist)
   (save-excursion
@@ -790,11 +806,11 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
                                       (elmo-file-cache-get message-id))
                                      (if seen
                                          nil
-                                       elmo-msgdb-unread-cached-mark)
+                                       already-mark)
                                    (if seen
                                        (if elmo-pop3-use-cache
-                                           elmo-msgdb-read-uncached-mark)
-                                     elmo-msgdb-new-mark))))
+                                           seen-mark)
+                                     new-mark))))
                  (setq mark-alist
                        (elmo-msgdb-mark-append
                         mark-alist
@@ -873,7 +889,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
          (elmo-display-progress
           'elmo-display-retrieval-progress
           "Retrieving..." 100)  ; remove progress bar.
-         (message "Retrieving...done."))
+         (message "Retrieving...done"))
        (set-buffer outbuf)
        (goto-char (point-min))
        (while (re-search-forward "^\\." nil t)