]> granicus.if.org Git - neomutt/commitdiff
boolify write fcc
authorRichard Russon <rich@flatcap.org>
Wed, 18 Jul 2018 21:33:01 +0000 (22:33 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 19 Jul 2018 09:56:47 +0000 (10:56 +0100)
compose.c
send.c
sendlib.c
sendlib.h

index a934a71e28cec488ad787a4b99855b217ff1bead..01f136517d323c7342b301cfb6e0715f2a693b79 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -1870,7 +1870,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen,
           if (msg->content->next)
             msg->content = mutt_make_multipart(msg->content);
 
-          if (mutt_write_fcc(fname, msg, NULL, 0, NULL, NULL) < 0)
+          if (mutt_write_fcc(fname, msg, NULL, false, NULL, NULL) < 0)
             msg->content = mutt_remove_multipart(msg->content);
           else
             mutt_message(_("Message written."));
diff --git a/send.c b/send.c
index 074db824ad3138d7f79ab0b6d3952d34d21e7221..b2d9c6ecc8aca17bda14b599ed93aa45f80aea8b 100644 (file)
--- a/send.c
+++ b/send.c
@@ -2117,7 +2117,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
 
       if (!Postponed || mutt_write_fcc(NONULL(Postponed), msg,
                                        (cur && (flags & SEND_REPLY)) ? cur->env->message_id : NULL,
-                                       1, fcc, NULL) < 0)
+                                       true, fcc, NULL) < 0)
       {
         msg->content = mutt_remove_multipart(msg->content);
         decode_descriptions(msg->content);
@@ -2329,7 +2329,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
        * message was first postponed.
        */
       msg->received = time(NULL);
-      if (mutt_write_multiple_fcc(fcc, msg, NULL, 0, NULL, &finalpath) == -1)
+      if (mutt_write_multiple_fcc(fcc, msg, NULL, false, NULL, &finalpath) == -1)
       {
         /* Error writing FCC, we should abort sending.  */
         fcc_error = true;
index dea071176b10060eb218988347ce0283e49acf24..13abedbaa3eff1f31d36817867092419eaafa54a 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -3157,7 +3157,7 @@ static void set_noconv_flags(struct Body *b, short flag)
  * @retval -1 Failure
  */
 int mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *msgid,
-                            int post, char *fcc, char **finalpath)
+                            bool post, char *fcc, char **finalpath)
 {
   char fcc_tok[PATH_MAX];
   char fcc_expanded[PATH_MAX];
@@ -3204,7 +3204,7 @@ int mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *ms
  * @retval -1 Failure
  */
 int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid,
-                   int post, char *fcc, char **finalpath)
+                   bool post, char *fcc, char **finalpath)
 {
   struct Context f;
   struct Message *msg = NULL;
@@ -3260,8 +3260,8 @@ int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid,
 
   /* post == 1 => postpone message. Set mode = -1 in mutt_rfc822_write_header()
    * post == 0 => Normal mode. Set mode = 0 in mutt_rfc822_write_header()
-   * */
-  mutt_rfc822_write_header(msg->fp, hdr->env, hdr->content, post ? -post : 0, false);
+   */
+  mutt_rfc822_write_header(msg->fp, hdr->env, hdr->content, post ? -1 : 0, false);
 
   /* (postponement) if this was a reply of some sort, <msgid> contains the
    * Message-ID: of message replied to.  Save it using a special X-Mutt-
index afd046eb87bc22d89c0b90c5feb127b354a04abe..089dc378f55eca5860c07d40070dd24994989b4c 100644 (file)
--- a/sendlib.h
+++ b/sendlib.h
@@ -72,10 +72,10 @@ void            mutt_stamp_attachment(struct Body *a);
 void            mutt_unprepare_envelope(struct Envelope *env);
 void            mutt_update_encoding(struct Body *a);
 void            mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool display);
-int             mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid, int post, char *fcc, char **finalpath);
+int             mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid, bool post, char *fcc, char **finalpath);
 int             mutt_write_mime_body(struct Body *a, FILE *f);
 int             mutt_write_mime_header(struct Body *a, FILE *f);
-int             mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *msgid, int post, char *fcc, char **finalpath);
+int             mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *msgid, bool post, char *fcc, char **finalpath);
 int             mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, int flags);
 void            mutt_write_references(const struct ListHead *r, FILE *f, size_t trim);