63 struct stat *ctx_sb,
bool check_stats)
65 struct stat sb = { 0 };
78 m_check->
type = mb_type;
82 ((m_check->
type ==
MUTT_UNKNOWN) && S_ISREG(sb.st_mode) && (sb.st_size == 0)) ||
101 ((sb.st_dev != ctx_sb->st_dev) || (sb.st_ino != ctx_sb->st_ino))))
103 switch (m_check->
type)
118 m_check->
size = (off_t) sb.st_size;
140 struct stat contex_sb;
142 bool check_stats =
false;
143 contex_sb.st_dev = 0;
144 contex_sb.st_ino = 0;
178 contex_sb.st_dev = 0;
179 contex_sb.st_ino = 0;
219 char mailboxlist[512];
227 mailboxlist[0] =
'\0';
228 pos += strlen(strncat(mailboxlist,
_(
"New mail in "),
sizeof(mailboxlist) - 1 - pos));
248 pos += strlen(strncat(mailboxlist + pos,
", ",
sizeof(mailboxlist) - 1 - pos));
257 pos += strlen(strncat(mailboxlist + pos,
mutt_b2s(path),
sizeof(mailboxlist) - 1 - pos));
264 strncat(mailboxlist + pos,
", ...",
sizeof(mailboxlist) - 1 - pos);
291 #ifdef HAVE_CLOCK_GETTIME 315 for (
int pass = 0; pass < 2; pass++)
356 #ifdef HAVE_UTIMENSAT 371 if (st->st_mtime > st->st_atime)
373 #ifdef HAVE_UTIMENSAT 378 utimensat(AT_FDCWD, buf, ts, 0);
380 ut.actime = st->st_atime;
387 #ifdef HAVE_UTIMENSAT 392 utimensat(AT_FDCWD, buf, ts, 0);
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Convenience wrapper for the gui headers.
time_t mutt_date_epoch(void)
Return the number of seconds since the Unix epoch.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
enum MailboxType type
Mailbox type.
bool mutt_mailbox_list(void)
List the mailboxes with new mail.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
off_t size
Size of the Mailbox.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
'NNTP' (Usenet) Mailbox type
void mutt_mailbox_cleanup(const char *path, struct stat *st)
Restore the timestamp of a mailbox.
#define mutt_message(...)
struct AccountList accounts
List of all Accounts.
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
struct Mailbox * mailbox_find(const char *path)
Find the mailbox with a given path.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
String manipulation buffer.
bool first_check_stats_done
True when the check have been done at least on time.
static time_t MailboxStatsTime
last time we check performed mail_check_stats
Mailbox wasn't recognised.
struct Mailbox * mutt_mailbox_next(struct Mailbox *m_cur, struct Buffer *s)
incoming folders completion routine
static void mailbox_check(struct Mailbox *m_cur, struct Mailbox *m_check, struct stat *ctx_sb, bool check_stats)
Check a mailbox for new mail.
Container for Accounts, Notifications.
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Some miscellaneous functions.
bool has_new
Mailbox has new mail.
struct timespec last_visited
Time of last exit from this mailbox.
Convenience wrapper for the core headers.
bool mutt_mailbox_notify(struct Mailbox *m_cur)
Notify the user if there's new mail.
static short MailboxCount
how many boxes with new mail
'Maildir' Mailbox type
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Prototypes for many functions.
static short MailboxNotify
of unnotified new boxes
short C_MailCheckStatsInterval
Config: How often to check for new mail.
struct WindowState state
Current state of the Window.
'POP3' Mailbox type
struct MuttWindow * MessageWindow
Message Window, ":set", etc.
size_t mutt_buffer_len(const struct Buffer *buf)
Calculate the length of a Buffer.
int mutt_mailbox_check(struct Mailbox *m_cur, int force)
Check all all Mailboxes for new mail.
'mmdf' Mailbox type
static time_t MailboxTime
last time we started checking for mail
'MH' Mailbox type
bool C_CheckMboxSize
Config: (mbox,mmdf) Use mailbox size as an indicator of new mail.
short C_MailCheck
Config: Number of seconds before NeoMutt checks for new mail.
WHERE bool C_MailCheckRecent
Config: Notify the user about new mail since the last time the mailbox was opened.
void mailbox_update(struct Mailbox *m)
Get the mailbox's current size.
#define STAILQ_FOREACH(var, head, field)
void mutt_update_num_postponed(void)
Force the update of the number of postponed messages.
bool newly_created
Mbox or mmdf just popped into existence.
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
#define MUTT_MAILBOX_CHECK_FORCE
'Notmuch' (virtual) Mailbox type
'mbox' Mailbox type
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
MailboxType
Supported mailbox formats.
int mx_mbox_check_stats(struct Mailbox *m, int flags)
Check the statistics for a mailbox - Wrapper for MxOps::mbox_check_stats()
bool notified
User has been notified.
Time value with nanosecond precision.
#define STAILQ_HEAD_INITIALIZER(head)
Hundreds of global variables to back the user variables.
void mutt_mailbox_set_notified(struct Mailbox *m)
Note when the user was last notified of new mail.
bool C_MailCheckStats
Config: Periodically check for new mail.
#define TAILQ_EMPTY(head)
Convenience wrapper for the library headers.
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
'IMAP' Mailbox type
struct Mailbox * mailbox
Mailbox in the list.
#define MUTT_MAILBOX_CHECK_FORCE_STATS