Update message count on command "select <folder>"
authorVitaly Mayatskikh <v.mayatskih@gmail.com>
Fri, 22 May 2009 16:19:55 +0000 (22 18:19 +0200)
committerVitaly Mayatskikh <v.mayatskih@gmail.com>
Fri, 22 May 2009 16:19:55 +0000 (22 18:19 +0200)
Partial update needs to know actual message count, it doesn't
have this info at the moment of execution. Command "select" on folder
enter returns message count in EXISTS fields. Update folder info with
this counter to allow partial update to work.

elmo/elmo-imap4.el

index 23d4d31..f9a111f 100644 (file)
@@ -2571,6 +2571,9 @@ If optional argument REMOVE is non-nil, remove FLAG."
                                (setq response
                                      (elmo-imap4-read-response session tag))))
                  (progn
+                   (let ((exists (assq 'exists response))) ; update message count,
+                     (when exists                          ; so merge update can go
+                       (elmo-folder-set-info-hashtb folder nil (cadr exists))))
                    (elmo-imap4-session-set-current-mailbox-internal
                     session mailbox)
                    (elmo-imap4-session-set-read-only-internal