From: Brendan Cully Date: Wed, 31 Oct 2007 21:04:48 +0000 (-0700) Subject: Fix the test for flushing queued STATUS requests in imap_buffy_check. X-Git-Tag: mutt-1-5-17-rel~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36392f692055cebbb5047bcb77a19e88e887eb90;p=mutt Fix the test for flushing queued STATUS requests in imap_buffy_check. 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. --- diff --git a/imap/imap.c b/imap/imap.c index bc1ca394..8ac9cef7 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -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);