Skip to content

Commit 327e6aa

Browse files
committed
Merge pull request #182 from dgets/message-remap-support
Message remap support
2 parents da0e3b6 + acce344 commit 327e6aa

3 files changed

Lines changed: 229 additions & 152 deletions

File tree

ddoc2.js

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,13 @@ docIface = {
238238
var ndx = subList[bbs.cursub].index;
239239
var mBase;
240240

241-
if (userSettings.debug.navigation) {
241+
if (userSettings.debug.message_scan) {
242242
console.putmsg(yellow + "Entering findNew()\nWorking with subList" +
243-
" of length: " + subList.length + "\nContents: " +
244-
subList.toString() + "\n");
243+
" of length " + subList.length + "; contents:\n");
244+
for each(var tmpSub in subList) {
245+
console.putmsg("* " + cyan + tmpSub.name + "\n");
246+
}
247+
console.putmsg("\n");
245248
}
246249

247250
for ( /* ndx already set */ ; ndx < subList.length ; ndx += 1 ) {
@@ -252,23 +255,31 @@ docIface = {
252255
+ "\n");
253256
}
254257

255-
if (!roomData.tieIns.isZapped(ndx)
256-
/*msg_area.sub[bbs.cursub_code].index)*/
257-
) {
258+
if (!roomData.tieIns.isZapped(ndx)) {
259+
mBase = msg_base.util.openNewMBase(subList[ndx].code);
260+
258261
if (userSettings.debug.navigation) {
259-
console.putmsg("Room not zapped\n");
262+
console.putmsg("Room not zapped\t\tscan_ptr: " +
263+
subList[ndx].scan_ptr + "\t\ttotal: " +
264+
mBase.total_msgs + "\n");
260265
}
261-
262-
mBase = msg_base.openNewMBase(subList[ndx].code);
263-
if (mBase == null) {
266+
267+
if (mBase == null) {
264268
break;
265269
}
266270

267-
if (subList[ndx].scan_ptr != mBase.total_msgs) {
271+
if (subList[ndx].scan_ptr < mBase.total_msgs) {
268272
docIface.nav.setSub(subList[ndx]);
269273
mBase.close();
270274
return subList[ndx];
271-
}
275+
} else if (subList[ndx].scan_ptr > mBase.total_msg) {
276+
//we've got some corrupt shit to fix here; not sure how it
277+
//happened but we might as well have a way to fix it
278+
subList[ndx].scan_ptr = mBase.first_msg;
279+
if (userSettings.debug.navigation) {
280+
console.putmsg(yellow + " just fixed scan ptrs\n");
281+
}
282+
}
272283
mBase.close();
273284
}
274285
}
@@ -309,7 +320,11 @@ docIface = {
309320
docIface.util.quitDdoc();
310321
}
311322
ouah = "Mail"; //vestigial?
312-
} else {
323+
} else if (uChoice == "") {
324+
//abort
325+
console.putmsg(yellow + "Aborted jump to new room . . .\n");
326+
return;
327+
} else {
313328
try {
314329
ouah = this.chk4Room(uChoice);
315330
} catch (e) {
@@ -329,7 +344,7 @@ docIface = {
329344
}
330345
}
331346

332-
if (ouah == "Mail") {
347+
if (ouah == "MAIL") {
333348
bbs.log_str("Jumped to Mail");
334349
} else {
335350
bbs.log_str("Jumped to " + this.setSub(ouah));
@@ -707,6 +722,7 @@ if (!debugOnly) {
707722
case 'o':
708723
case 'k':
709724
case '-':
725+
case '%':
710726
msg_base.entry_level.handler(uchoice);
711727
break;
712728
//other msg base shit

0 commit comments

Comments
 (0)