Skip to content
Snippets Groups Projects
Commit 211d107b authored by deuce's avatar deuce
Browse files

More fixups...

When QUOTES.TXT exists, use it as the quoter data and use the passed filename
ONLY as the file to save as.
When QUOTES.TXT does NOT exist, there is no quoter data, the passed filename
is both the input and output of the edited message.
parent a2dc93f6
No related branches found
No related tags found
No related merge requests found
...@@ -1697,7 +1697,7 @@ function edit(quote_first) ...@@ -1697,7 +1697,7 @@ function edit(quote_first)
break; break;
break; break;
case '\x1a': /* CTRL-Z (EOF) (PgUp in SyncEdit) */ case '\x1a': /* CTRL-Z (EOF) (PgUp in SyncEdit) */
var f=new File(system.temp_dir+"INPUT.MSG"); var f=new File((argc==0?system.temp_dir+"INPUT.MSG":argv[0]));
f.open("w"); f.open("w");
var s=make_strings(true,true); var s=make_strings(true,true);
f.write(s[0]); f.write(s[0]);
...@@ -1742,6 +1742,13 @@ function edit(quote_first) ...@@ -1742,6 +1742,13 @@ function edit(quote_first)
var old_status=bbs.sys_status; var old_status=bbs.sys_status;
var input_filename=system.node_dir+"QUOTES.TXT"; var input_filename=system.node_dir+"QUOTES.TXT";
var use_quotes=true;
input_filename=file_getcase(input_filename);
if(input_filename==undefined) {
use_quotes=false;
if(argc==1 && input_filename==undefined)
input_filename=argv[0];
}
bbs.sys_status&=~SS_PAUSEON; bbs.sys_status&=~SS_PAUSEON;
bbs.sys_status|=SS_PAUSEOFF; bbs.sys_status|=SS_PAUSEOFF;
var oldpass=console.ctrlkey_passthru; var oldpass=console.ctrlkey_passthru;
...@@ -1749,23 +1756,16 @@ console.ctrlkey_passthru="+ACGKLOPQRUVWXYZ_"; ...@@ -1749,23 +1756,16 @@ console.ctrlkey_passthru="+ACGKLOPQRUVWXYZ_";
/* Enable delete line in SyncTERM (Disabling ANSI Music in the process) */ /* Enable delete line in SyncTERM (Disabling ANSI Music in the process) */
console.write("\033[=1M"); console.write("\033[=1M");
console.clear(); console.clear();
if(argc==1)
input_filename=argv[0];
var f=new File(input_filename); var f=new File(input_filename);
line.push(new Line());
if(f.open("r",false)) { if(f.open("r",false)) {
ypos=0; ypos=0;
if(input_filename.search(/(quotes.msg|input.msg)$/i) != -1) { if(use_quotes)
quote_line=make_lines(quote_msg(word_wrap(f.read(),76)),''); quote_line=make_lines(quote_msg(word_wrap(f.read(),76)),'');
edit(true); else
}
else {
line=make_lines(word_wrap(f.read()),''); line=make_lines(word_wrap(f.read()),'');
edit(false);
}
} }
else if(line.length==0)
edit(false); line.push(new Line());
edit(use_quotes);
console.ctrlkey_passthru=oldpass; console.ctrlkey_passthru=oldpass;
bbs.sys_status=old_status; bbs.sys_status=old_status;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment