Skip to content
Snippets Groups Projects
Commit e588a807 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

When saving messages, prompt for plain-text (if "No", then save "source").

Often you may only want the plain-text portion of a message (e.g. for
printing).
parent 439c60fb
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -660,7 +660,7 @@ function mail_reply(msg, reply_all)
}
}
function download_msg_source(msg)
function download_msg(msg, plain_text)
{
var fname = system.temp_dir + "msg_" + msg.number + ".txt";
var f = new File(fname);
......@@ -670,8 +670,9 @@ function download_msg_source(msg)
,/* strip ctrl-a */false
,/* dot-stuffing */false
,/* tails */true
,/* plain-text */false);
f.write(msg.get_rfc822_header(/* force_update: */false, /* unfold: */false));
,plain_text);
f.write(msg.get_rfc822_header(/* force_update: */false, /* unfold: */false
,/* default_content_type */!plain_text));
f.writeln(text);
f.close();
return bbs.send_file(fname);
......@@ -1046,8 +1047,8 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name)
break;
case 'D':
console.clearline();
if(!console.noyes("Download message source", P_NOCRLF)) {
if(!download_msg_source(list[current], msgbase))
if(!console.noyes("Download message", P_NOCRLF)) {
if(!download_msg(list[current], msgbase, console.yesno("Plain-text only")))
alert("failed");
}
console.creturn();
......@@ -1124,8 +1125,8 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name)
break;
case 'D':
console.clearline();
if(!console.noyes("Download message source", P_NOCRLF)) {
if(!download_msg_source(list[current], msgbase))
if(!console.noyes("Download message", P_NOCRLF)) {
if(!download_msg(list[current], msgbase, console.yesno("Plain-text only")))
alert("failed");
continue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment