Skip to content
Snippets Groups Projects
Commit 30e94134 authored by rswindell's avatar rswindell
Browse files

This module can now:

- be used to enter the inter-BBS instant message module with the 'I' command
  (this should make responding to inter-BBS instant messages much easier as
  the recipient can respond from anywhere using Ctrl-P global hotkey).
- be installed using "jsexec privatemsg.js install"
parent 8c4ff37e
No related branches found
No related tags found
No related merge requests found
......@@ -7,10 +7,33 @@
// Install this module in SCFG->External Programs->Global Hot Key Events:
// Global Hot Key Ctrl-P
// Command Line ?privatemsg.js
//
// or, by running "jsexec privatemsg.js install"
if(argc == 1 && argv[0] == "install") {
var cnflib = load({}, "cnflib.js");
var xtrn_cnf = cnflib.read("xtrn.cnf");
if(!xtrn_cnf) {
alert("Failed to read xtrn.cnf");
exit(-1);
}
xtrn_cnf.hotkey.push({ key: /* Ctrl-P */16, cmd: '?privatemsg.js' });
if(!cnflib.write("xtrn.cnf", undefined, xtrn_cnf)) {
alert("Failed to write xtrn.cnf");
exit(-1);
}
exit(0);
}
require("sbbsdefs.js", 'SS_USERON');
require("text.js", 'PrivateMsgPrompt');
bbs.replace_text(PrivateMsgPrompt,
"\r\n\1b\1hPrivate: \1g~T\1n\1gelegram, " +
"\1h~M\1n\1gessage, \1h~C\1n\1ghat, \1h~I\1n\1gnter-BBS, or \1h~Q\1n\1guit: \1c\1h");
if(!(bbs.sys_status&SS_USERON))
exit();
......@@ -28,7 +51,7 @@ while(bbs.online && !(console.aborted)) {
var ch;
while(bbs.online && !console.aborted) { /* Watch for incoming messages */
ch=console.inkey(/* mode: */K_UPPER, /* timeout: */1000);
if(ch && "TMCQ\r".indexOf(ch)>=0)
if(ch && "TMCIQ\r".indexOf(ch)>=0)
break;
console.line_counter = 0;
......@@ -54,6 +77,10 @@ while(bbs.online && !(console.aborted)) {
bbs.private_chat();
bbs.node_action = saved_node_action;
break;
case 'I': /* Inter-BBS */
console.print("Inter-BBS\r\n");
load({}, 'sbbsimsg.js');
break;
default:
console.print("Quit\r\n");
exit();
......
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