Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit d81f6e81 authored by Rob Swindell's avatar Rob Swindell 💬

Add/use a general pause() routine with a configurable duration

By default, just use console.pause() (the "hit a key" prompt), but
if [msglist] pause is set to a delay duration (in seconds, fractions
supported), then delay instead. If pause is set to false, don't delay
or pause.

Do the delay/pause thing after posting messages too (not just email).
parent a7589318
...@@ -322,6 +322,14 @@ function help() ...@@ -322,6 +322,14 @@ function help()
console.pause(); console.pause();
} }
function pause()
{
if(typeof options.pause == "number")
mswait(Number(options.pause) * 1000);
else if(options.pause !== false)
console.pause();
}
function list_msg(msg, digits, selected, sort, msg_ctrl, exclude, is_operator) function list_msg(msg, digits, selected, sort, msg_ctrl, exclude, is_operator)
{ {
var color = color_cfg.column[0]; var color = color_cfg.column[0];
...@@ -1040,10 +1048,11 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name) ...@@ -1040,10 +1048,11 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name)
case 'R': case 'R':
if(mail) { if(mail) {
mail_reply(list[current], key == 'A'); mail_reply(list[current], key == 'A');
console.pause(); pause();
} else { } else {
console.clear(); console.clear();
bbs.post_msg(msgbase.subnum, list[current]); bbs.post_msg(msgbase.subnum, list[current]);
pause();
return true; return true;
} }
break; break;
...@@ -1064,7 +1073,7 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name) ...@@ -1064,7 +1073,7 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name)
break; break;
case 'M': case 'M':
mail_reply(list[current]); mail_reply(list[current]);
console.pause(); pause();
break; break;
case 'D': case 'D':
console.clearline(); console.clearline();
...@@ -1237,16 +1246,17 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name) ...@@ -1237,16 +1246,17 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name)
case 'R': case 'R':
if(mail) { if(mail) {
mail_reply(list[current], key.toUpperCase() == 'A'); mail_reply(list[current], key.toUpperCase() == 'A');
console.pause(); pause();
} else { } else {
console.clear(); console.clear();
bbs.post_msg(msgbase.subnum, list[current]); bbs.post_msg(msgbase.subnum, list[current]);
pause();
return true; // reload msgs return true; // reload msgs
} }
break; break;
case 'M': case 'M':
mail_reply(list[current]); mail_reply(list[current]);
console.pause(); pause();
break; break;
case 'S': case 'S':
if(sort == undefined) if(sort == undefined)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment