* wl-folder.el (wl-folder-check-one-entity): Use `new' value of diff.
authorteranisi <teranisi>
Thu, 8 Nov 2001 03:32:34 +0000 (03:32 +0000)
committerteranisi <teranisi>
Thu, 8 Nov 2001 03:32:34 +0000 (03:32 +0000)
* wl-util.el (wl-biff-check-folder-async-callback): Ditto.

* mmimap.el (mmimap-entity-section): If node-id is nil, return "0".

* elmo.el (elmo-diff-new): New inline function.
(elmo-diff-unread): Ditto.
(elmo-diff-all): Ditto.

* elmo-imap4.el (elmo-imap4-server-diff-async-callback-1): Get recent
value from responseb.
(elmo-imap4-folder-diff-plugged): Ditto.
(elmo-imap4-server-diff-async): Added recent argument.
(elmo-server-diff-async): Ditto.
(elmo-imap4-folder-diff-plugged): Ditto.

elmo/ChangeLog
elmo/elmo-imap4.el
elmo/elmo.el
elmo/mmimap.el
wl/ChangeLog
wl/wl-folder.el
wl/wl-util.el

index dcaaa92..9135b09 100644 (file)
@@ -1,9 +1,20 @@
 2001-11-08  Yuuichi Teranishi  <teranisi@gohome.org>
 
-       * elmo-version.el (elmo-version): Up to 2.7.6.
-
        * mmimap.el (mmimap-entity-section): If node-id is nil, return "0".
 
+       * elmo.el (elmo-diff-new): New inline function.
+       (elmo-diff-unread): Ditto.
+       (elmo-diff-all): Ditto.
+
+       * elmo-imap4.el (elmo-imap4-server-diff-async-callback-1): Get recent
+       value from responseb.
+       (elmo-imap4-folder-diff-plugged): Ditto.
+       (elmo-imap4-server-diff-async): Added recent argument.
+       (elmo-server-diff-async): Ditto.
+       (elmo-imap4-folder-diff-plugged): Ditto.
+
+       * elmo-version.el (elmo-version): Up to 2.7.6.
+
 2001-11-05  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * elmo-util.el (elmo-parse-token): Fixed how to treat quoted-pair
index 25d421c..e6942b3 100644 (file)
@@ -1070,7 +1070,8 @@ If CHOP-LENGTH is not specified, message set is not chopped."
 
 (defun elmo-imap4-server-diff-async-callback-1 (status data)
   (funcall elmo-imap4-server-diff-async-callback
-          (cons (elmo-imap4-response-value status 'unseen)
+          (list (elmo-imap4-response-value status 'recent)
+                (elmo-imap4-response-value status 'unseen)
                 (elmo-imap4-response-value status 'messages))
           data))
 
@@ -1089,7 +1090,7 @@ If CHOP-LENGTH is not specified, message set is not chopped."
                              "status "
                              (elmo-imap4-mailbox
                               (elmo-imap4-folder-mailbox-internal folder))
-                             " (unseen messages)"))))
+                             " (recent unseen messages)"))))
 
 (luna-define-method elmo-server-diff-async ((folder elmo-imap4-folder))
   (let ((session (elmo-imap4-get-session folder)))
@@ -1105,7 +1106,7 @@ If CHOP-LENGTH is not specified, message set is not chopped."
                              "status "
                              (elmo-imap4-mailbox
                               (elmo-imap4-folder-mailbox-internal folder))
-                             " (unseen messages)"))))
+                             " (recent unseen messages)"))))
 
 ;;; IMAP parser.
 
@@ -2247,7 +2248,7 @@ If optional argument REMOVE is non-nil, remove FLAG."
                                         (elmo-imap4-mailbox
                                          (elmo-imap4-folder-mailbox-internal
                                           folder))
-                                        " (unseen messages)")))
+                                        " (recent unseen messages)")))
     (setq response (elmo-imap4-response-value response 'status))
     (setq messages (elmo-imap4-response-value response 'messages))
     (setq killed (elmo-msgdb-killed-list-load (elmo-folder-msgdb-path folder)))
@@ -2255,7 +2256,8 @@ If optional argument REMOVE is non-nil, remove FLAG."
        (setq messages (- messages
                          (elmo-msgdb-killed-list-length
                           killed))))
-    (cons (elmo-imap4-response-value response 'unseen)
+    (list (elmo-imap4-response-value response 'recent)
+         (elmo-imap4-response-value response 'unseen)
          messages)))
 
 (luna-define-method elmo-folder-diff-plugged ((folder elmo-imap4-folder))
index b059bd2..1e09e33 100644 (file)
@@ -771,6 +771,20 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).")
      info-alist)
     (setq elmo-folder-info-hashtb hashtb)))
 
+(defsubst elmo-diff-new (diff)
+  (when (consp (cdr diff))
+    (car diff)))
+
+(defsubst elmo-diff-unread (diff)
+  (if (consp (cdr diff))
+      (nth 1 diff)
+    (car diff)))
+
+(defsubst elmo-diff-all (diff)
+  (if (consp (cdr diff))
+      (nth 2 diff)
+    (cdr diff)))
+
 (defsubst elmo-strict-folder-diff (folder)
   "Return folder diff information strictly from FOLDER."
   (let* ((dir (elmo-folder-msgdb-path folder))
index b8a167c..0eb752e 100644 (file)
@@ -61,6 +61,8 @@ SECTION is a section string which is defined in RFC2060.")
 (defun mmimap-entity-section (node-id)
   "Return a section string from NODE-ID"
   (cond
+   ((null node-id)
+    "0")
    ((numberp node-id)
     (number-to-string (1+ node-id)))
    ((listp node-id)
index afad3fd..fe649a9 100644 (file)
@@ -1,5 +1,9 @@
 2001-11-08  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * wl-folder.el (wl-folder-check-one-entity): Use `new' value of diff.
+
+       * wl-util.el (wl-biff-check-folder-async-callback): Ditto.
+
        * Version number is increased to 2.7.6.
 
 2001-11-05  Yuuichi Teranishi  <teranisi@gohome.org>
index 611e4b0..b25110d 100644 (file)
@@ -811,6 +811,8 @@ Optional argument ARG is repeart count."
                           (not (elmo-folder-exists-p folder)))
                      (wl-folder-create-subr folder)
                    (signal (car err) (cdr err))))))
+        (new (elmo-diff-new nums))
+        (nums (cons (elmo-diff-unread nums) (elmo-diff-all nums)))
         unread unsync nomif)
     (if (and (eq wl-folder-notify-deleted 'sync)
             (car nums)
@@ -825,14 +827,15 @@ Optional argument ARG is repeart count."
       (setq unread (or ;; If server diff, All unreads are
                        ; treated as unsync.
                    (if (elmo-folder-use-flag-p folder)
-                       0)
+                       (car nums))
                    (elmo-folder-get-info-unread folder)
                    (wl-summary-count-unread (elmo-msgdb-mark-load
                                              (elmo-folder-msgdb-path
                                               folder)))))
       (setq unread (min unread (- (or (cdr nums) 0) (or (car nums) 0))))
+      (when new (setq unread (- unread new)))
       (wl-folder-entity-hashtb-set wl-folder-entity-hashtb entity
-                                  (list (car nums)
+                                  (list (or new (car nums))
                                         unread
                                         (cdr nums))
                                   (get-buffer wl-folder-buffer-name)))
@@ -840,7 +843,7 @@ Optional argument ARG is repeart count."
     (sit-for 0)
     (list (if wl-folder-notify-deleted
              (car nums)
-           (max (or (car nums) 0))) unread (cdr nums))))
+           (or new (max (or (car nums) 0)))) unread (cdr nums))))
 
 (defun wl-folder-check-entity-async (entity &optional auto)
   (let ((elmo-nntp-groups-async t)
index 3a288af..208a2ca 100644 (file)
@@ -833,7 +833,9 @@ This function is imported from Emacs 20.7."
       (with-current-buffer (nth 1 data)
        (wl-folder-entity-hashtb-set wl-folder-entity-hashtb
                                     (nth 0 data)
-                                    (list (car diff) 0 (cdr diff))
+                                    (list (nth 0 diff)
+                                          (nth 1 diff)
+                                          (nth 2 diff))
                                     (current-buffer))))
   (setq wl-folder-info-alist-modified t)
   (setq wl-biff-check-folders-running nil)