struct stat contex_sb;
time_t now, last1;
CONTEXT *ctx;
- int i = 0, local = 0;
+ int i = 0, local = 0, count = 0;
#ifdef USE_IMAP
time_t last2;
BuffyCount = 0;
BuffyNotify = 0;
+ count = sidebar_need_count ();
+
if (!Context || !Context->path ||
(mx_is_local (Context->magic-1) && stat (Context->path, &contex_sb) != 0)) {
/* check device ID and serial number instead of comparing paths */
case M_MMDF:
/* only check on force or $mail_check reached */
if (force != 0 || (now - last1 >= BuffyTimeout)) {
- if (SidebarWidth == 0 || !option (OPTMBOXPANE)) {
+ if (!count) {
if (STAT_CHECK) {
BuffyCount++;
tmp->new = 1;
}
#endif
}
- else if (SidebarWidth > 0 && option (OPTMBOXPANE) &&
- (STAT_CHECK || tmp->msgcount == 0)) {
+ else if (STAT_CHECK || tmp->msgcount == 0) {
/* sidebar visible */
BuffyCount++;
if ((ctx =
if (tmp->new == 0) {
BuffyCount++;
tmp->new = 1;
- if (SidebarWidth == 0 || !option (OPTMBOXPANE))
+ if (!count)
/* if sidebar invisible -> done */
break;
}
}
closedir (dirp);
- if (SidebarWidth > 0 && option (OPTMBOXPANE)) {
+ if (count) {
/* only count total mail if sidebar visible */
snprintf (path, sizeof (path), "%s/cur", tmp->path);
if ((dirp = opendir (path)) == NULL) {
if (force != 0 || (now - last1 >= BuffyTimeout)) {
if ((tmp->new = mh_buffy (tmp->path)) > 0)
BuffyCount++;
- if (SidebarWidth > 0 && option (OPTMBOXPANE)) {
+ if (count) {
DIR *dp;
struct dirent *de;