* Changes in NeoMutt only affect the tmp file.
* Calling comp_mbox_sync() will commit them to the compressed file.
*/
-static int comp_mbox_sync(struct Context *ctx, int *index_hint)
+static int comp_mbox_sync(struct Mailbox *m, int *index_hint)
{
- if (!ctx || !ctx->mailbox || !ctx->mailbox->compress_info)
+ if (!m || !m->compress_info)
return -1;
- struct Mailbox *m = ctx->mailbox;
struct CompressInfo *ci = m->compress_info;
if (!ci->close)
if (rc != 0)
goto sync_cleanup;
- rc = ops->mbox_sync(ctx, index_hint);
+ rc = ops->mbox_sync(m, index_hint);
if (rc != 0)
goto sync_cleanup;
int maildir_path_pretty(char *buf, size_t buflen, const char *folder);
int mh_mbox_check (struct Mailbox *m, int *index_hint);
int mh_mbox_close (struct Mailbox *m);
-int mh_mbox_sync (struct Context *ctx, int *index_hint);
+int mh_mbox_sync (struct Mailbox *m, int *index_hint);
int mh_msg_close (struct Mailbox *m, struct Message *msg);
/* Maildir/MH shared functions */
/**
* mh_mbox_sync - Implements MxOps::mbox_sync()
*/
-int mh_mbox_sync(struct Context *ctx, int *index_hint)
+int mh_mbox_sync(struct Mailbox *m, int *index_hint)
{
- if (!ctx || !ctx->mailbox)
+ if (!m)
return -1;
- struct Mailbox *m = ctx->mailbox;
-
int i, j;
#ifdef USE_HCACHE
header_cache_t *hc = NULL;
/**
* mbox_mbox_sync - Implements MxOps::mbox_sync()
*/
-static int mbox_mbox_sync(struct Context *ctx, int *index_hint)
+static int mbox_mbox_sync(struct Mailbox *m, int *index_hint)
{
- if (!ctx || !ctx->mailbox)
+ if (!m)
return -1;
- struct Mailbox *m = ctx->mailbox;
-
struct MboxAccountData *adata = mbox_adata_get(m);
if (!adata)
return -1;
*/
new_offset[i - first].hdr = ftello(fp) + offset;
- if (mutt_copy_message_ctx(fp, ctx->mailbox, m->emails[i], MUTT_CM_UPDATE,
+ if (mutt_copy_message_ctx(fp, m, m->emails[i], MUTT_CM_UPDATE,
CH_FROM | CH_UPDATE | CH_UPDATE_LEN) != 0)
{
mutt_perror(tempfile);
mutt_message(_("Writing %s..."), m->path);
}
- int rc = m->mx_ops->mbox_sync(ctx, index_hint);
+ int rc = m->mx_ops->mbox_sync(m, index_hint);
if ((rc != 0) && !m->quiet)
{
/* L10N: Displayed if a mailbox sync fails */
int (*mbox_check_stats)(struct Mailbox *m, int flags);
/**
* mbox_sync - Save changes to the mailbox
- * @param ctx Mailbox to sync
+ * @param m Mailbox to sync
* @param index_hint Remember our place in the index
* @retval 0 Success
* @retval -1 Failure
*/
- int (*mbox_sync) (struct Context *ctx, int *index_hint);
+ int (*mbox_sync) (struct Mailbox *m, int *index_hint);
/**
* mbox_close - Close a mailbox
* @param m Mailbox to close
*
* @note May also return values from check_mailbox()
*/
-static int nntp_mbox_sync(struct Context *ctx, int *index_hint)
+static int nntp_mbox_sync(struct Mailbox *m, int *index_hint)
{
- if (!ctx || !ctx->mailbox)
+ if (!m)
return -1;
- struct Mailbox *m = ctx->mailbox;
-
struct NntpMboxData *mdata = m->mdata;
int rc;
#ifdef USE_HCACHE
#endif
/* save .newsrc entries */
- nntp_newsrc_gen_entries(ctx->mailbox);
+ nntp_newsrc_gen_entries(m);
nntp_newsrc_update(mdata->adata);
nntp_newsrc_close(mdata->adata);
return 0;
/**
* nm_mbox_sync - Implements MxOps::mbox_sync()
*/
-static int nm_mbox_sync(struct Context *ctx, int *index_hint)
+static int nm_mbox_sync(struct Mailbox *m, int *index_hint)
{
- if (!ctx || !ctx->mailbox)
+ if (!m)
return -1;
- struct Mailbox *m = ctx->mailbox;
-
struct NmMboxData *mdata = nm_mdata_get(m);
if (!mdata)
return -1;
*
* Update POP mailbox, delete messages from server
*/
-static int pop_mbox_sync(struct Context *ctx, int *index_hint)
+static int pop_mbox_sync(struct Mailbox *m, int *index_hint)
{
- if (!ctx || !ctx->mailbox)
+ if (!m)
return -1;
- struct Mailbox *m = ctx->mailbox;
-
int i, j, ret = 0;
char buf[LONG_STRING];
struct PopAccountData *adata = pop_get_adata(m);