- if ( Context && !strcmp( tmp->path, Context->path ) ) {
- printw( "%.*s", SidebarWidth - delim_len,
- make_sidebar_entry(basename(tmp->path),
- Context->msgcount, Context->unread, Context->flagged));
- tmp->msg_unread = Context->unread;
- tmp->msgcount = Context->msgcount;
- tmp->msg_flagged = Context->flagged;
+ if (option(OPTSIDEBARNEWMAILONLY)) {
+ if (tmp->msg_unread > 0) {
+ if ( Context && !strcmp( tmp->path, Context->path ) ) {
+ printw( "%.*s", SidebarWidth - delim_len,
+ make_sidebar_entry(basename(tmp->path),
+ Context->msgcount, Context->unread, Context->flagged));
+ tmp->msg_unread = Context->unread;
+ tmp->msgcount = Context->msgcount;
+ tmp->msg_flagged = Context->flagged;
+ }
+ else
+ printw( "%.*s", SidebarWidth - delim_len,
+ make_sidebar_entry(basename(tmp->path),
+ tmp->msgcount,tmp->msg_unread, tmp->msg_flagged));
+ lines++;
+ }
+ } else {
+ if ( Context && !strcmp( tmp->path, Context->path ) ) {
+ printw( "%.*s", SidebarWidth - delim_len,
+ make_sidebar_entry(basename(tmp->path),
+ Context->msgcount, Context->unread, Context->flagged));
+ tmp->msg_unread = Context->unread;
+ tmp->msgcount = Context->msgcount;
+ tmp->msg_flagged = Context->flagged;
+ }
+ else
+ printw( "%.*s", SidebarWidth - delim_len,
+ make_sidebar_entry(basename(tmp->path),
+ tmp->msgcount,tmp->msg_unread, tmp->msg_flagged));
+ lines++;