if (mutt_enter_fname ("Write message to mailbox", fname, sizeof (fname),
&menu->redraw, 1) != -1 && fname[0])
{
+ int oldhdrdate;
mutt_message ("Writing message to %s ...", fname);
mutt_expand_path (fname, sizeof (fname));
if (msg->content->next)
msg->content = mutt_make_multipart (msg->content);
- if (mutt_write_fcc (NONULL (fname), msg, NULL, 2) < 0)
+ oldhdrdate = option(OPTUSEHEADERDATE);
+ set_option(OPTUSEHEADERDATE);
+ if (mutt_write_fcc (NONULL (fname), msg, NULL, 1) < 0)
msg->content = mutt_remove_multipart (msg->content);
else
mutt_message ("Message written.");
+ if(!oldhdrdate) unset_option(OPTUSEHEADERDATE);
}
break;
CHECK_MSGCOUNT;
CHECK_READONLY;
-
+
+ set_option(OPTUSEHEADERDATE);
ci_send_message (SENDEDITMSG, NULL, NULL, Context, CURHDR);
+ unset_option(OPTUSEHEADERDATE);
menu->redraw = REDRAW_FULL;
break;
OPTSORTSUBTHREADS, /* (pseudo) used when $sort_aux changes */
OPTNEEDRESCORE, /* (pseudo) set when the `score' command is used */
OPTSORTCOLLAPSE, /* (pseudo) used by mutt_sort_headers() */
-
+ OPTUSEHEADERDATE, /* (pseudo) used by edit-message */
+
#ifdef _PGPPATH
OPTPGPCHECKTRUST, /* (pseudo) used by pgp_select_key () */
OPTDONTHANDLEPGPKEYS, /* (pseudo) used to extract PGP keys */
-
OPTMAX
};
* mode == 1 => "lite" mode (used for edit_hdrs)
* mode == 0 => normal mode. write full header + MIME headers
* mode == -1 => write just the envelope info (used for postponing messages)
- * mode == -2 => just like -1, but write the Date: from the message (used for edit-message support)
*/
int mutt_write_rfc822_header (FILE *fp, ENVELOPE *env, BODY *attach, int mode)
char buffer[LONG_STRING];
LIST *tmp = env->userhdrs;
- if (mode == 0)
- fputs (mutt_make_date (buffer, sizeof(buffer)), fp);
- else if (mode == -2)
+ if (option(OPTUSEHEADERDATE))
{
if(env->date)
fprintf(fp, "Date: %s\n", env->date);
else
fputs (mutt_make_date(buffer, sizeof(buffer)), fp);
}
+ else if (mode == 0)
+ fputs (mutt_make_date (buffer, sizeof(buffer)), fp);
+
/* OPTUSEFROM is not consulted here so that we can still write a From:
}
/* post == 1 => postpone message. Set mode = -1 in mutt_write_rfc822_header()
- * post == 2 => Editing this message.
- * Set mode = -2 in mutt_write_rfc822_header()
* post == 0 => Normal mode. Set mode = 0 in mutt_write_rfc822_header()
* */
mutt_write_rfc822_header (msg->fp, hdr->env, hdr->content, post ? -post : 0);