From: Richard Russon Date: Wed, 18 Jul 2018 21:33:01 +0000 (+0100) Subject: boolify write fcc X-Git-Tag: 2019-10-25~749^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6b77868b0b284f353dd4a1871dca0fe3ab2851e;p=neomutt boolify write fcc --- diff --git a/compose.c b/compose.c index a934a71e2..01f136517 100644 --- 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 074db824a..b2d9c6ecc 100644 --- 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; diff --git a/sendlib.c b/sendlib.c index dea071176..13abedbaa 100644 --- 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, contains the * Message-ID: of message replied to. Save it using a special X-Mutt- diff --git a/sendlib.h b/sendlib.h index afd046eb8..089dc378f 100644 --- 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);