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

Add "MSGS" command to redisplay instant messages (notices/telegrams)

parent 0c9513fd
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -842,6 +842,49 @@ function str_cmds(str)
}
}
}
if(str=="HELP") {
writeln("MSGS");
writeln("\tRedisplay instant messages (notifications and telegrams).");
}
if(word == "MSGS") {
var num = -1;
loop:
while (bbs.online && !console.aborted) {
var msg = system.data_dir + "msgs/" + format("%04u", user.number) + ".last.msg";
if(num >= 0)
msg = system.data_dir + "msgs/" + format("%04u", user.number) + ".last." + num + ".msg";
console.clear();
if(!file_exists(msg))
break;
var timestamp = system.timestr(file_date(msg));
print("\1n\1cInstant messages displayed \1h" + timestamp);
console.printfile(msg, P_NOATCODES);
console.mnemonics("\r\n~Quit, ~Recent, ~Prev, or [~Next]: ");
prmpt:
switch(console.getkeys("\b-+[]\x02\x1e\x0a\x1d\x06RPN\rQ")) {
case 'R':
case KEY_HOME:
num = -1;
break;
case 'P':
case '\b':
case '-':
case '[':
case KEY_UP:
case KEY_LEFT:
if(num >=0)
num--;
else
console.beep();
break;
case 'Q':
break loop;
default:
num++;
break;
}
}
}
}
//### Generic routine to ask user for parameter if one wasn't specified ###
......
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