]> granicus.if.org Git - neomutt/commitdiff
mx api: swap mx_commit_message() params
authorRichard Russon <rich@flatcap.org>
Wed, 6 Jun 2018 01:16:05 +0000 (02:16 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 6 Jun 2018 12:31:13 +0000 (13:31 +0100)
for consistency with the other api functions

attach.c
copy.c
editmsg.c
mailbox.h
mh.c
mx.c
pop.c
sendlib.c

index 96d3b6573d742266eaee16b1015b9151c8ce1360..025134056b025fe2d447dec27d23c0c6a4b53cd2 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -798,7 +798,7 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct
         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;
       }
diff --git a/copy.c b/copy.c
index d6607c4c142bf7e5a6b9857317dc8d9f0b441ce5..51fbc951ca067d16e2a189991454c25bbaf5e473 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -831,7 +831,7 @@ static int append_message(struct Context *dest, FILE *fpin, struct Context *src,
     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
index c98025a08b4911d4e73562db977dac923d8baf85..f3aaa62f5153a4d926400761610910ea6a87d2a1 100644 (file)
--- a/editmsg.c
+++ b/editmsg.c
@@ -227,7 +227,7 @@ static int edit_or_view_one_message(bool edit, struct Context *ctx, struct Heade
     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);
index 5a6cb22400e5e6335d52fe55070bf8b1c5622207..2b361e44392dbe176522112380b25b228f021d8c 100644 (file)
--- a/mailbox.h
+++ b/mailbox.h
@@ -85,7 +85,7 @@ void mx_fastclose_mailbox(struct Context *ctx);
 
 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);
diff --git a/mh.c b/mh.c
index 3e16c15215417c9bed123979ae93d1b6f3d11403..a25764739256d3c2dcaa94547209adadc03f2621 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -1585,7 +1585,7 @@ static int maildir_msg_open_new(struct Context *ctx, struct Message *msg,
  *
  * 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:
diff --git a/mx.c b/mx.c
index dd611f83b485298e202dfcbe3e8f21d70e597781..e14fa40e65ebff4baff983af394f737c1264f8f6 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1280,7 +1280,7 @@ struct Message *mx_open_message(struct Context *ctx, int msgno)
  * @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;
diff --git a/pop.c b/pop.c
index a9358563fb0799b84fec05465c48b724a86f6864..1022803149c97167411bbf641591ce4503b23d05 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -969,7 +969,7 @@ void pop_fetch_mail(void)
       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;
index b2d57ae629f92380239bea616f6cc9c82b557541..d62ae9930d2b6006ac36900e9d0a1a823b0de794 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -3090,7 +3090,7 @@ int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid,
       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;
@@ -3118,7 +3118,7 @@ int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid,
     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);