From: Richard Russon Date: Mon, 25 Jul 2016 19:25:23 +0000 (-0700) Subject: Fix imap buffy msg_count overwrite issue. X-Git-Tag: mutt-1-7-rel~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c26dec73c03a832787df276a50d2e4802c0b2cdb;p=mutt Fix imap buffy msg_count overwrite issue. The sidebar updates the buffy->msg_count with the context. This can cause it to become out of sync with the imap_mboxcache. If the imap_buffy doesn't request MESSAGES, don't overwrite the buffy->msg_count with a stale value. --- diff --git a/imap/command.c b/imap/command.c index c9140242..4d34d242 100644 --- a/imap/command.c +++ b/imap/command.c @@ -901,6 +901,7 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s) unsigned int olduv, oldun; long litlen; short new = 0; + short new_msg_count = 0; mailbox = imap_next_word (s); @@ -940,7 +941,10 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s) count = strtol (value, &value, 10); if (!ascii_strncmp ("MESSAGES", s, 8)) + { status->messages = count; + new_msg_count = 1; + } else if (!ascii_strncmp ("RECENT", s, 6)) status->recent = count; else if (!ascii_strncmp ("UIDNEXT", s, 7)) @@ -1019,7 +1023,8 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s) SidebarNeedsRedraw = 1; #endif inc->new = new; - inc->msg_count = status->messages; + if (new_msg_count) + inc->msg_count = status->messages; inc->msg_unread = status->unseen; if (inc->new)