chflags |= CH_FROM | CH_FORCE_FROM;
chflags |= (dest->mailbox->magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
r = mutt_copy_message_fp(msg->fp, fpin, e, flags, chflags);
- if (mx_msg_commit(dest, msg) != 0)
+ if (mx_msg_commit(dest->mailbox, msg) != 0)
r = -1;
#ifdef USE_NOTMUCH
mutt_file_copy_stream(fp, msg->fp);
}
- rc = mx_msg_commit(tmpctx, msg);
+ rc = mx_msg_commit(tmpctx->mailbox, msg);
mx_msg_close(tmpctx->mailbox, &msg);
mx_mbox_close(&tmpctx, NULL);
chflags = CH_FROM | CH_UPDATE_LEN;
chflags |= (ctx->mailbox->magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
if ((mutt_copy_message_fp(msg->fp, fp, en, 0, chflags) == 0) &&
- (mx_msg_commit(ctx, msg) == 0))
+ (mx_msg_commit(ctx->mailbox, msg) == 0))
{
r = 0;
}
}
/**
- * mx_msg_commit - commit a message to a folder
+ * mx_msg_commit - Commit a message to a folder - Wrapper for MxOps::msg_commit()
+ * @param m Mailbox
* @param msg Message to commit
- * @param ctx Mailbox
* @retval 0 Success
* @retval -1 Failure
*/
-int mx_msg_commit(struct Context *ctx, struct Message *msg)
+int mx_msg_commit(struct Mailbox *m, struct Message *msg)
{
- if (!ctx || !ctx->mailbox || !ctx->mailbox->mx_ops || !ctx->mailbox->mx_ops->msg_commit)
+ if (!m || !m->mx_ops || !m->mx_ops->msg_commit)
return -1;
- struct Mailbox *m = ctx->mailbox;
-
if (!(msg->write && m->append))
{
mutt_debug(1, "msg->write = %d, m->append = %d\n", msg->write, m->append);
struct Context *mx_mbox_open (struct Mailbox *m, const char *path, int flags);
int mx_mbox_sync (struct Context *ctx, int *index_hint);
int mx_msg_close (struct Mailbox *m, struct Message **msg);
-int mx_msg_commit (struct Context *ctx, struct Message *msg);
+int mx_msg_commit (struct Mailbox *m, struct Message *msg);
struct Message *mx_msg_open_new (struct Mailbox *m, struct Email *e, int flags);
struct Message *mx_msg_open (struct Mailbox *m, int msgno);
int mx_msg_padding_size(struct Mailbox *m);
if (ret == -3)
rset = 1;
- if (ret == 0 && mx_msg_commit(ctx, msg) != 0)
+ if (ret == 0 && mx_msg_commit(ctx->mailbox, msg) != 0)
{
rset = 1;
ret = -3;
mutt_debug(1, "%s: write failed.\n", tempfile);
mutt_file_fclose(&tempfp);
unlink(tempfile);
- mx_msg_commit(f, msg); /* XXX really? */
+ mx_msg_commit(f->mailbox, msg); /* XXX really? */
mx_msg_close(f->mailbox, &msg);
mx_mbox_close(&f, NULL);
goto done;
rc = mutt_write_mime_body(e->content, msg->fp);
}
- if (mx_msg_commit(f, msg) != 0)
+ if (mx_msg_commit(f->mailbox, msg) != 0)
rc = -1;
else if (finalpath)
*finalpath = mutt_str_strdup(msg->committed_path);