X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=buffy.c;h=b00170b41df4709d08de275e5155545d6dad8334;hp=126cf8c7f583d53036e30b5d84464de68a3deab8;hb=e745050e2e9e1078a009828ed6db68fd72db771c;hpb=5f6b586de5a46f2359a4fc392fd89f1716d847a3 diff --git a/buffy.c b/buffy.c index 126cf8c..b00170b 100644 --- a/buffy.c +++ b/buffy.c @@ -260,7 +260,7 @@ int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data, /* values for force: * 0 don't force any checks + update sidebar * 1 force all checks + update sidebar - * 2 force all checks + _don't_ update sidebar + * 2 don't force any checks + _don't_ update sidebar */ int buffy_check (int force) { @@ -277,7 +277,7 @@ int buffy_check (int force) time_t last2; /* update postponed count as well, on force */ - if (force != 0) + if (force == 1) mutt_update_num_postponed (); #endif @@ -294,11 +294,11 @@ int buffy_check (int force) return BuffyCount; last1 = BuffyTime; - if (force != 0 || now - BuffyTime >= BuffyTimeout) + if (force == 1 || now - BuffyTime >= BuffyTimeout) BuffyTime = now; #ifdef USE_IMAP last2 = ImapBuffyTime; - if (force != 0 || now - ImapBuffyTime >= ImapBuffyTimeout) + if (force == 1 || now - ImapBuffyTime >= ImapBuffyTimeout) ImapBuffyTime = now; #endif BuffyCount = 0; @@ -337,7 +337,7 @@ int buffy_check (int force) case M_MBOX: case M_MMDF: /* only check on force or $mail_check reached */ - if (force != 0 || (now - last1 >= BuffyTimeout)) { + if (force == 1 || (now - last1 >= BuffyTimeout)) { if (!count) { if (STAT_CHECK) { BuffyCount++; @@ -373,7 +373,7 @@ int buffy_check (int force) case M_MAILDIR: /* only check on force or $mail_check reached */ - if (force != 0 || (now - last1 >= BuffyTimeout)) { + if (force == 1 || (now - last1 >= BuffyTimeout)) { snprintf (path, sizeof (path), "%s/new", tmp->path); if ((dirp = opendir (path)) == NULL) { tmp->magic = 0; @@ -390,10 +390,11 @@ int buffy_check (int force) /* one new and undeleted message is enough */ if (tmp->new == 0) { BuffyCount++; - tmp->new = 1; - if (!count) + if (!count) { /* if sidebar invisible -> done */ + tmp->new = 1; break; + } } tmp->msgcount++; tmp->msg_unread++; @@ -431,7 +432,7 @@ int buffy_check (int force) case M_MH: /* only check on force or $mail_check reached */ - if (force != 0 || (now - last1 >= BuffyTimeout)) { + if (force == 1 || (now - last1 >= BuffyTimeout)) { if ((tmp->new = mh_buffy (tmp->path)) > 0) BuffyCount++; if (count) { @@ -461,7 +462,7 @@ int buffy_check (int force) #ifdef USE_IMAP case M_IMAP: /* only check on force or $imap_mail_check reached */ - if (force != 0 || (now - last2 >= ImapBuffyTimeout)) { + if (force == 1 || (now - last2 >= ImapBuffyTimeout)) { tmp->msgcount = imap_mailbox_check (tmp->path, 0); tmp->new = imap_mailbox_check (tmp->path, 1); tmp->msg_unread = imap_mailbox_check (tmp->path, 2);