*/
int imap_mbox_check_stats(struct Mailbox *m, int flags)
{
- int rc = imap_mailbox_status(m, true);
- if (rc > 0)
- rc = 1;
- return rc;
+ return imap_mailbox_status(m, true);
}
/**
* imap_mailbox_status - Refresh the number of total and new messages
* @param m Mailbox
* @param queue Queue the STATUS command
- * @retval num Total number of messages
+ * @retval num Total number of messages
+ * @retval -1 Error
*
* @note Prepare the mailbox if we are not connected
*/
if (check_new || check_stats)
maildir_check_dir(m, "cur", check_new, check_stats);
- return (m->msg_new > 0);
+ return m->msg_new;
}
/**
if (m->msg_new == 0)
m->has_new = false;
- return (m->msg_new > 0);
+ return m->msg_new;
}
// clang-format off
case MUTT_MAILDIR:
case MUTT_MH:
case MUTT_NOTMUCH:
- if ((mx_mbox_check_stats(m_check, check_stats) == 1) && m_check->has_new)
+ if ((mx_mbox_check_stats(m_check, check_stats) > 0) && m_check->has_new)
MailboxCount++;
break;
default:; /* do nothing */
* @param m Mailbox to check
* @param flags Function flags
* @retval 0 Success, no new mail
- * @retval 1 Success, some new mail
+ * @retval >0 Success, number of new emails
* @retval -1 Failure
*/
int (*mbox_check_stats)(struct Mailbox *m, int flags);