Skip to content

Commit 37725e1

Browse files
committed
Began implementation of jumping to message by number; issue #130
1 parent ef80a60 commit 37725e1

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

ddoc2.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ load("/sbbs/exec/load/nodedefs.js");
2828
//pseudo-globals
2929
const excuse = "\n\nThe rothe strikes! You die!. . .\n\n",
3030
debugOnly = false, topebaseno = 6,
31-
alwaysLogout = false, std_logging = true;
31+
alwaysLogout = false, std_logging = true, maxMsgs = 500;
3232

3333
//a few easier hooks for the ctrl-a codes
3434
const ctrl_a = "\1";
@@ -816,6 +816,24 @@ if (!debugOnly) {
816816
roomData.tieIns.zapRoom(bbs.cursub);
817817
}
818818
break;
819+
case '0':
820+
case '1':
821+
case '2':
822+
case '3':
823+
case '4':
824+
case '5':
825+
case '6':
826+
case '7':
827+
case '8':
828+
case '9': //we're going to read message by number here
829+
//there will, of course, have to be some error checking for
830+
//trying to hit out of bounds messages if dispMsg() doesn't
831+
//already have it
832+
console.putmsg(green + high_intensity + "Go to message #> ");
833+
console.ungetstr(uchoice); //put it back on the input stack
834+
msg_base.dispMsg(new MsgBase(bbs.cursub_code),
835+
console.getnum(maxMsgs), false);
836+
break;
819837
case '$': //change debugging flags for this user
820838
var dropOut = false;
821839
var un;

load/dmbase.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ msg_base = {
476476
} catch (e) {
477477
console.putmsg(red + "Unable to open Mail> sub:\t" + e.message +
478478
"\n");
479-
throw new dDocException("dispMsg() Error",
479+
throw new docIface.dDocException("dispMsg() Error",
480480
"Unable to open mail sub: " + e.message, 2);
481481
}
482482
}
@@ -502,7 +502,7 @@ msg_base = {
502502
console.putmsg(red + "Invalid message? base.subnum: "
503503
+ base.subnum + " ptr: " + ptr + "\n");
504504
}
505-
throw new dDocException("dispMsg() error",
505+
throw new docIface.dDocException("dispMsg() error",
506506
"Invalid message slot", 3); // Invalid message, skip
507507
}
508508

0 commit comments

Comments
 (0)