In mx_check_mailbox, imap mailbox is the only function with a different
prototype: it has an extra force argument.
In order to move the check operation to the mx_ops structure, we need
that all mailboxes have the same prototype. To do so, a new function
imap_check_mailbox_reopen is added.
return result;
}
+int imap_check_mailbox_reopen (CONTEXT *ctx, int *index_hint)
+{
+ int rc;
+
+ imap_allow_reopen (ctx);
+ rc = imap_check_mailbox (ctx, index_hint, 0);
+ imap_disallow_reopen (ctx);
+
+ return rc;
+}
+
/* split path into (idata,mailbox name) */
static int imap_get_mailbox (const char* path, IMAP_DATA** hidata, char* buf, size_t blen)
{
/* imap.c */
int imap_access (const char*, int);
int imap_check_mailbox (CONTEXT *ctx, int *index_hint, int force);
+int imap_check_mailbox_reopen (CONTEXT *ctx, int *index_hint);
int imap_delete_mailbox (CONTEXT* idata, IMAP_MBOX mx);
int imap_open_mailbox_append (CONTEXT *ctx);
int imap_sync_mailbox (CONTEXT *ctx, int expunge, int *index_hint);
#ifdef USE_IMAP
case MUTT_IMAP:
- /* caller expects that mailbox may change */
- imap_allow_reopen (ctx);
- rc = imap_check_mailbox (ctx, index_hint, 0);
- imap_disallow_reopen (ctx);
- return rc;
+ return imap_check_mailbox_reopen (ctx, index_hint);
#endif /* USE_IMAP */
#ifdef USE_POP