sidebar update (indicator placement, correct use of ctx->new, ...)
git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@177
e385b8ad-14ed-0310-8656-
cc95a2468c6d
DIR *dirp;
char path[_POSIX_PATH_MAX];
struct stat contex_sb;
- time_t now, last1, last2;
+ time_t now, last1;
CONTEXT *ctx;
#ifdef USE_IMAP
+ time_t last2;
/* update postponed count as well, on force */
if (force != 0)
mutt_update_num_postponed ();
tmp->size = (long) sb.st_size; /* update the size */
#endif
- if (!tmp->new)
+ if (tmp->new <= 0)
tmp->notified = 0;
else if (!tmp->notified)
BuffyNotify++;
for (tmp = Incoming; tmp; tmp = tmp->next)
{
/* Is there new mail in this mailbox? */
- if (!tmp->new || (have_unnotified && tmp->notified))
+ if (tmp->new <= 0 || (have_unnotified && tmp->notified))
continue;
strfcpy (path, tmp->path, sizeof (path));
case 1:
- while (tmp && !tmp->new)
+ while (tmp && tmp->new <= 0)
tmp = tmp->next;
if (!tmp)
{
{
if (mutt_strcmp (s, tmp->path) == 0)
count++;
- else if (count && tmp->new)
+ else if (count && tmp->new > 0)
break;
tmp = tmp->next;
if (!tmp)
{
#ifdef BUFFY_SIZE
tmp = mutt_find_mailbox (buf);
- if (tmp && !tmp->new)
+ if (tmp && tmp->new <= 0)
mutt_update_mailbox (tmp);
#else
/* fix up the times so buffy won't get confused */
#endif
IndexHelp);
- if (!attach_msg)
+ if (!attach_msg) {
mutt_buffy_check(1); /* force the buffy check after we enter the folder */
+ /* record folder we open to place sidebar indicator properly */
+ if (Context && Context->path)
+ set_curbuffy(Context->path);
+ }
FOREVER
{
{
if (strcmp (tmp->path, Context->path) == 0)
{
+ tmp->new = Context->new;
tmp->msg_unread = Context->unread;
tmp->msgcount = Context->msgcount;
tmp->msg_flagged = Context->flagged;
lines = option(OPTHELP) ? 1 : 0; /* go back to the top */
if ( CurBuffy == 0 ) CurBuffy = Incoming;
+#if 0
if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 )
+#endif
calc_boundaries(menu);
tmp = TopBuffy;
snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
snprintf (buf, buflen, fmt, Context ? Context->new : 0);
}
- else if (!Context || !Context->new)
+ else if (!Context || Context->new <= 0)
optional = 0;
break;