In SET-IMAP-FOLDER-LENGTH!, when there are no messages in a folder, it
authorChris Hanson <org/chris-hanson/cph>
Mon, 8 May 2000 20:48:59 +0000 (20:48 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 8 May 2000 20:48:59 +0000 (20:48 +0000)
can be treated using the same strategy as when the folder is
synchronized.

v7/src/imail/imail-imap.scm

index 596dc9373bc0472db1c040bb65c80297967e8ac7..506d7bbcf738c3c46552399addf0f67b8153b9a2 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-imap.scm,v 1.22 2000/05/08 20:38:12 cph Exp $
+;;; $Id: imail-imap.scm,v 1.23 2000/05/08 20:48:59 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
 ;;; operation atomically.
 
 (define (set-imap-folder-length! folder count)
-  (if (imap-folder-messages-synchronized? folder)
+  (if (or (imap-folder-messages-synchronized? folder)
+         (= 0 (imap-folder-n-messages folder)))
       (read-message-headers!
        folder
        (without-interrupts