X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=buffy.c;h=126cf8c7f583d53036e30b5d84464de68a3deab8;hp=28f88ace63b39b0e3597dfb581b24a41aa07acf6;hb=5f6b586de5a46f2359a4fc392fd89f1716d847a3;hpb=3cc6735712a1894a3bf1c24dfb719ddae882ef61;ds=sidebyside diff --git a/buffy.c b/buffy.c index 28f88ac..126cf8c 100644 --- a/buffy.c +++ b/buffy.c @@ -463,14 +463,14 @@ int buffy_check (int force) /* only check on force or $imap_mail_check reached */ if (force != 0 || (now - last2 >= ImapBuffyTimeout)) { tmp->msgcount = imap_mailbox_check (tmp->path, 0); - if ((tmp->new = imap_mailbox_check (tmp->path, 1)) > 0) { + tmp->new = imap_mailbox_check (tmp->path, 1); + tmp->msg_unread = imap_mailbox_check (tmp->path, 2); + if (tmp->new > 0) BuffyCount++; - tmp->msg_unread = tmp->new; /* for sidebar; wtf? */ - } - else { + else tmp->new = 0; + if (tmp->msg_unread < 0) tmp->msg_unread = 0; - } } else if (tmp->new > 0) /* keep current stats if !force and !$imap_mail_check reached */