chflags = CH_FROM | CH_UPDATE_LEN;
chflags |= (ctx.magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
if (mutt_copy_message_fp(msg->fp, fp, hn, 0, chflags) == 0 &&
- mx_commit_message(msg, &ctx) == 0)
+ mx_commit_message(&ctx, msg) == 0)
{
r = 0;
}
chflags |= CH_FROM | CH_FORCE_FROM;
chflags |= (dest->magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
r = mutt_copy_message_fp(msg->fp, fpin, hdr, flags, chflags);
- if (mx_commit_message(msg, dest) != 0)
+ if (mx_commit_message(dest, msg) != 0)
r = -1;
#ifdef USE_NOTMUCH
mutt_file_copy_stream(fp, msg->fp);
}
- rc = mx_commit_message(msg, &tmpctx);
+ rc = mx_commit_message(&tmpctx, msg);
mx_close_message(&tmpctx, &msg);
mx_close_mailbox(&tmpctx, NULL);
int mx_close_mailbox(struct Context *ctx, int *index_hint);
int mx_sync_mailbox(struct Context *ctx, int *index_hint);
-int mx_commit_message(struct Message *msg, struct Context *ctx);
+int mx_commit_message(struct Context *ctx, struct Message *msg);
int mx_close_message(struct Context *ctx, struct Message **msg);
int mx_get_magic(const char *path);
int mx_set_magic(const char *s);
*
* hdr is a header structure to which we write the message's new
* file name. This is used in the mh and maildir folder synch
- * routines. When this routine is invoked from mx_commit_message,
+ * routines. When this routine is invoked from mx_commit_message(),
* hdr is NULL.
*
* msg->path looks like this:
* @retval 0 Success
* @retval -1 Failure
*/
-int mx_commit_message(struct Message *msg, struct Context *ctx)
+int mx_commit_message(struct Context *ctx, struct Message *msg)
{
if (!ctx->mx_ops || !ctx->mx_ops->msg_commit)
return -1;
if (ret == -3)
rset = 1;
- if (ret == 0 && mx_commit_message(msg, &ctx) != 0)
+ if (ret == 0 && mx_commit_message(&ctx, msg) != 0)
{
rset = 1;
ret = -3;
mutt_debug(1, "%s: write failed.\n", tempfile);
mutt_file_fclose(&tempfp);
unlink(tempfile);
- mx_commit_message(msg, &f); /* XXX - really? */
+ mx_commit_message(&f, msg); /* XXX - really? */
mx_close_message(&f, &msg);
mx_close_mailbox(&f, NULL);
goto done;
rc = mutt_write_mime_body(hdr->content, msg->fp);
}
- if (mx_commit_message(msg, &f) != 0)
+ if (mx_commit_message(&f, msg) != 0)
rc = -1;
else if (finalpath)
*finalpath = mutt_str_strdup(msg->commited_path);