]> granicus.if.org Git - mutt/commitdiff
Fix the test for flushing queued STATUS requests in imap_buffy_check.
authorBrendan Cully <brendan@kublai.com>
Wed, 31 Oct 2007 21:04:48 +0000 (14:04 -0700)
committerBrendan Cully <brendan@kublai.com>
Wed, 31 Oct 2007 21:04:48 +0000 (14:04 -0700)
This should fix the bug that caused every other IMAP connection to
fail to get the new message counts. Thanks to exg for his generous
help debugging this one.

imap/imap.c

index bc1ca394b36aef9f37bf7a8dd1e8d81a588bef1d..8ac9cef710002c80ef3c00eb93e487f8eea851b3 100644 (file)
@@ -1461,11 +1461,15 @@ int imap_buffy_check (int force)
      * IDLEd elsewhere */
     if (!imap_mxcmp (name, idata->mailbox))
       continue;
-      
-    if (!lastdata)
-      lastdata = idata;
 
-    if (idata != lastdata)
+    if (!mutt_bit_isset (idata->capabilities, IMAP4REV1) &&
+        !mutt_bit_isset (idata->capabilities, STATUS))
+    {
+      dprint (2, (debugfile, "Server doesn't support STATUS\n"));
+      continue;
+    }
+
+    if (lastdata && idata != lastdata)
     {
       /* Send commands to previous server. Sorting the buffy list
        * may prevent some infelicitous interleavings */
@@ -1475,13 +1479,9 @@ int imap_buffy_check (int force)
       lastdata = NULL;
     }
 
-    if (!mutt_bit_isset (idata->capabilities, IMAP4REV1) &&
-        !mutt_bit_isset (idata->capabilities, STATUS))
-    {
-      dprint (2, (debugfile, "Server doesn't support STATUS\n"));
-      continue;
-    }
-    
+    if (!lastdata)
+      lastdata = idata;
+
     imap_munge_mbox_name (munged, sizeof (munged), name);
     snprintf (command, sizeof (command),
              "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT)", munged);