* Checks the specified maildir subdir (cur or new) for new mail or mail counts.
*/
static int buffy_maildir_check_dir(struct Buffy *mailbox, const char *dir_name,
- int check_new, int check_stats)
+ bool check_new, bool check_stats)
{
char path[LONG_STRING];
char msgpath[LONG_STRING];
if (stat(path, &sb) == 0 && sb.st_mtime < mailbox->last_visited)
{
rc = 0;
- check_new = 0;
+ check_new = false;
}
}
}
mailbox->new = true;
rc = 1;
- check_new = 0;
+ check_new = false;
if (!check_stats)
break;
}
* @param check_stats if true, also count total, new, and flagged messages
* @retval 1 if the mailbox has new mail
*/
-static int buffy_maildir_check(struct Buffy *mailbox, int check_stats)
+static int buffy_maildir_check(struct Buffy *mailbox, bool check_stats)
{
- int rc, check_new = 1;
+ int rc = 1;
+ bool check_new = true;
if (check_stats)
{
* @param check_stats if true, also count total, new, and flagged messages
* @retval 1 if the mailbox has new mail
*/
-static int buffy_mbox_check(struct Buffy *mailbox, struct stat *sb, int check_stats)
+static int buffy_mbox_check(struct Buffy *mailbox, struct stat *sb, bool check_stats)
{
int rc = 0;
int new_or_changed;
return rc;
}
-static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, int check_stats)
+static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_stats)
{
struct stat sb;
#ifdef USE_SIDEBAR
break;
case MUTT_MH:
- if (mh_buffy(tmp, check_stats) > 0)
+ if (mh_buffy(tmp, check_stats))
BuffyCount++;
break;
#ifdef USE_NOTMUCH
/** mark mailbox just left as already notified */
void mutt_buffy_setnotified(const char *path);
-int mh_buffy(struct Buffy *mailbox, int check_stats);
+bool mh_buffy(struct Buffy *mailbox, bool check_stats);
#endif /* _MUTT_BUFFY_H */
* @param check_stats Also count total, new, and flagged messages
* @retval true if the mailbox has new mail
*/
-int mh_buffy(struct Buffy *mailbox, int check_stats)
+bool mh_buffy(struct Buffy *mailbox, bool check_stats)
{
struct MhSequences mhs;
- int check_new = 1;
- int rc = 0;
+ bool check_new = true;
+ bool rc = false;
DIR *dirp = NULL;
struct dirent *de = NULL;
* since the last mailbox visit, there is no "new mail" */
if (option(OPT_MAIL_CHECK_RECENT) && mh_sequences_changed(mailbox) <= 0)
{
- rc = 0;
- check_new = 0;
+ rc = false;
+ check_new = false;
}
if (!(check_new || check_stats))
memset(&mhs, 0, sizeof(mhs));
if (mh_read_sequences(&mhs, mailbox->path) < 0)
- return 0;
+ return false;
if (check_stats)
{
if (!option(OPT_MAIL_CHECK_RECENT) || mh_already_notified(mailbox, i) == 0)
{
mailbox->new = true;
- rc = 1;
+ rc = true;
}
/* Because we are traversing from high to low, we can stop
* checking for new mail after the first unseen message.
* Whether it resulted in "new mail" or not. */
- check_new = 0;
+ check_new = false;
if (!check_stats)
break;
}