diff options
Diffstat (limited to 'send.c')
-rw-r--r-- | send.c | 44 |
1 files changed, 6 insertions, 38 deletions
@@ -375,7 +375,7 @@ static int include_reply (CONTEXT *ctx, HEADER *cur, FILE *out) if (Attribution) { - mutt_make_string (buffer, sizeof (buffer), Attribution, cur); + mutt_make_string (buffer, sizeof (buffer), Attribution, ctx, cur); fputs (buffer, out); fputc ('\n', out); } @@ -385,45 +385,13 @@ static int include_reply (CONTEXT *ctx, HEADER *cur, FILE *out) mutt_copy_message (out, ctx, cur, flags, CH_DECODE); if (PostIndentString) { - mutt_make_string (buffer, sizeof (buffer), PostIndentString, cur); + mutt_make_string (buffer, sizeof (buffer), PostIndentString, ctx, cur); fputs (buffer, out); fputc ('\n', out); } return 0; } -static BODY *make_forward (CONTEXT *ctx, HEADER *hdr) -{ - char buffer[LONG_STRING]; - BODY *body; - FILE *fpout; - - mutt_mktemp (buffer); - if ((fpout = safe_fopen (buffer, "w")) == NULL) - return NULL; - - body = mutt_new_body (); - body->type = TYPEMESSAGE; - body->subtype = safe_strdup ("rfc822"); - body->filename = safe_strdup (buffer); - body->unlink = 1; - body->use_disp = 0; - - /* this MUST come after setting ->filename because we reuse buffer[] */ - strfcpy (buffer, "Forwarded message from ", sizeof (buffer)); - rfc822_write_address (buffer + 23, sizeof (buffer) - 23, hdr->env->from); - body->description = safe_strdup (buffer); - - mutt_parse_mime_message (ctx, hdr); - mutt_copy_message (fpout, ctx, hdr, - option (OPTMIMEFORWDECODE) ? M_CM_DECODE : 0, - CH_XMIT | (option (OPTMIMEFORWDECODE) ? (CH_MIME | CH_TXTPLAIN ) : 0)); - - fclose (fpout); - mutt_update_encoding (body); - return (body); -} - static int default_to (ADDRESS **to, ENVELOPE *env, int group) { char prompt[STRING]; @@ -584,7 +552,7 @@ envelope_defaults (ENVELOPE *env, CONTEXT *ctx, HEADER *cur, int flags) if (InReplyTo) { strfcpy (buffer, "In-Reply-To: ", sizeof (buffer)); - mutt_make_string (buffer + 13, sizeof (buffer) - 13, InReplyTo, cur); + mutt_make_string (buffer + 13, sizeof (buffer) - 13, InReplyTo, ctx, cur); tmp = env->userhdrs; while (tmp && tmp->next) tmp = tmp->next; @@ -613,7 +581,7 @@ envelope_defaults (ENVELOPE *env, CONTEXT *ctx, HEADER *cur, int flags) else if (flags & SENDFORWARD) { /* set the default subject for the message. */ - mutt_make_string (buffer, sizeof (buffer), ForwFmt, cur); + mutt_make_string (buffer, sizeof (buffer), ForwFmt, ctx, cur); env->subject = safe_strdup (buffer); } @@ -669,7 +637,7 @@ generate_body (FILE *tempfp, /* stream for outgoing message */ if (cur) { - tmp = make_forward (ctx, cur); + tmp = mutt_make_message_attach (ctx, cur); if (last) last->next = tmp; else @@ -681,7 +649,7 @@ generate_body (FILE *tempfp, /* stream for outgoing message */ { if (ctx->hdrs[ctx->v2r[i]]->tagged) { - tmp = make_forward (ctx, ctx->hdrs[ctx->v2r[i]]); + tmp = mutt_make_message_attach (ctx, ctx->hdrs[ctx->v2r[i]]); if (last) { last->next = tmp; |