- SETCOLOR(MT_COLOR_NORMAL);
-
- /* draw the divider */
-
- for ( ; lines < LINES-2-(menu != MENU_PAGER); lines++ ) {
- move(lines, SidebarWidth - 1);
- addch('|');
- #ifndef USE_SLANG_CURSES
- mvchgat(lines, SidebarWidth - 1, 1, 0, color_pair, NULL);
- #endif
- }
- if ( Incoming == 0 ) return 0;
- lines = option(OPTHELP) ? 1 : 0; /* go back to the top */
-
- if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 )
- calc_boundaries(menu);
- if ( CurBuffy == 0 ) CurBuffy = Incoming;
-
- tmp = TopBuffy;
-
- SETCOLOR(MT_COLOR_NORMAL);
-
- for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER); tmp = tmp->next ) {
- if ( tmp == CurBuffy )
- SETCOLOR(MT_COLOR_INDICATOR);
- else if ( tmp->msg_unread > 0 )
- SETCOLOR(MT_COLOR_NEW);
- else
- SETCOLOR(MT_COLOR_NORMAL);
-
- move( lines, 0 );
- if ( Context && !strcmp( tmp->path, Context->path ) ) {
- printw( "%.*s", SidebarWidth,
- make_sidebar_entry(basename(tmp->path), Context->msgcount,
- Context->unread));
- tmp->msg_unread = Context->unread;
- tmp->msgcount = Context->msgcount;
- }
- else
- printw( "%.*s", SidebarWidth,
- make_sidebar_entry(basename(tmp->path), tmp->msgcount,
- tmp->msg_unread));
- lines++;
- }
- SETCOLOR(MT_COLOR_NORMAL);
- for ( ; lines < LINES - 2 - (menu != MENU_PAGER); lines++ ) {
- int i = 0;
- move( lines, 0 );
- for ( ; i < SidebarWidth - 1; i++ )
- addch(' ');
- }
- return 0;
+ calc_boundaries (menu);
+
+ tmp = TopBuffy;
+
+ for (;
+ tmp && lines < LINES - 1 - (menu != MENU_PAGER
+ || option (OPTSTATUSONTOP));
+ tmp = tmp->next) {
+ if (tmp == CurBuffy)
+ SETCOLOR (MT_COLOR_INDICATOR);
+ else if (tmp->msg_flagged > 0)
+ SETCOLOR (MT_COLOR_FLAGGED);
+ else if (tmp->msg_unread > 0)
+ SETCOLOR (MT_COLOR_NEW);
+ else
+ SETCOLOR (MT_COLOR_NORMAL);
+
+ move (lines, 0);
+ 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++;
+ }
+ }
+ SETCOLOR (MT_COLOR_NORMAL);
+ for (; lines < LINES - 1 - (menu != MENU_PAGER || option (OPTSTATUSONTOP));
+ lines++) {
+ int i = 0;
+
+ move (lines, 0);
+ for (; i < SidebarWidth - delim_len; i++)
+ addch (' ');
+ }
+ return 0;