mutt_file_fclose(&adata->fp);
/* fix up the times so mailbox won't get confused */
- if (m->peekonly && mutt_buffer_is_empty(&m->pathbuf) &&
+ if (m->peekonly && !mutt_buffer_is_empty(&m->pathbuf) &&
(mutt_file_timespec_compare(&m->mtime, &adata->atime) > 0))
{
#ifdef HAVE_UTIMENSAT
if (m->newly_created && ((sb.st_ctime != sb.st_mtime) || (sb.st_ctime != sb.st_atime)))
m->newly_created = false;
- if (mutt_file_stat_timespec_compare(&sb, MUTT_STAT_MTIME, &m->stats_last_checked) > 0)
+ if (flags && mutt_file_stat_timespec_compare(&sb, MUTT_STAT_MTIME, &m->stats_last_checked) > 0)
{
struct Context *ctx = mx_mbox_open(m, MUTT_QUIET | MUTT_NOSORT | MUTT_PEEK);
if (ctx)
}
}
+ if (m->msg_new == 0)
+ m->has_new = false;
+
return (m->msg_new > 0);
}
m_check->magic = mb_magic;
break;
default:
- m_check->has_new = false;
+ if (m_cur == m_check)
+ m_check->has_new = false;
if ((stat(mailbox_path(m_check), &sb) != 0) ||
(S_ISREG(sb.st_mode) && (sb.st_size == 0)) ||
m->msg_flagged = 0;
m->rights = MUTT_ACL_ALL;
- if (flags & MUTT_QUIET)
- m->quiet = true;
+ m->quiet = (flags & MUTT_QUIET);
if (flags & MUTT_READONLY)
m->readonly = true;
- if (flags & MUTT_PEEK)
- m->peekonly = true;
+ m->peekonly = (flags & MUTT_PEEK);
if (flags & (MUTT_APPEND | MUTT_NEWFOLDER))
{