Skip to content

Commit b56880c

Browse files
committed
Merge pull request #147 from dgets/message-base-logoff
Fixed #110 with some kludge; had to duplicate code but there didn't s…
2 parents 5d0f310 + 5d64abb commit b56880c

1 file changed

Lines changed: 34 additions & 5 deletions

File tree

load/dmbase.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ msg_base = {
9898
break;
9999
case 'b': //change scan direction
100100
bbs.log_key("b");
101-
valid = true; hollaBack = 2;
101+
valid = true;hollaBack = 2;
102102
docIface.log_str_n_char(this.log_header, 'b');
103103
console.putmsg(green + high_intensity + "Back (change " +
104104
"direction)...\n");
@@ -130,7 +130,7 @@ msg_base = {
130130
break;
131131
case 's': //stop scan
132132
bbs.log_key("s");
133-
valid = true; hollaBack = 1;
133+
valid = true;hollaBack = 1;
134134
docIface.log_str_n_char(this.log_header, 's');
135135
console.putmsg(yellow + high_intensity + "Stop\n");
136136
break;
@@ -158,13 +158,42 @@ msg_base = {
158158
if (uchoice == "n") {
159159
bbs.log_key("n");
160160
}
161-
valid = true; hollaBack = 0;
161+
valid = true;hollaBack = 0;
162162
docIface.log_str_n_char(this.log_header, 'n');
163163
console.putmsg(green + high_intensity + "Next\n");
164164
break;
165165
case 'l': //logout
166166
bbs.log_key("l");
167-
docIface.util.quitDdoc();
167+
//docIface.util.quitDdoc();
168+
//let's see if this'll just work from here
169+
170+
if (userSettings.debug.flow_control) {
171+
console.putmsg(red + "\nRestoring bbs.* properties:\n" +
172+
" bbs.cursub: " + docIface.util.preSubBoard + "\n" +
173+
" bbs.curgrp: " + docIface.util.preMsgGroup + "\n" +
174+
" bbs.curdir: " + docIface.util.preFileDir + "\n");
175+
console.putmsg(red + "\nRestoring user.settings . . .\n");
176+
}
177+
178+
//restore initial settings prior to exit
179+
bbs.cursub = docIface.util.preSubBoard;
180+
user.cursub = bbs.cursub_code;
181+
bbs.curgrp = docIface.util.preMsgGroup;
182+
bbs.curdir = docIface.util.preFileDir;
183+
user.settings = docIface.util.preUserSettings;
184+
185+
//disable H exemption in case they go back to usual shell so that
186+
//we can handle events, etc
187+
user.security.exemptions &= ~UFLAG_H;
188+
//restore asynchronous message status (if necessary)
189+
bbs.sys_status ^= SS_MOFF;
190+
191+
console.putmsg(blue + high_intensity + "\n\nHope to see you " +
192+
"again soon!\n\nPeace out!\n");
193+
194+
bbs.logoff(); //this works, but does not reset settings;
195+
//I hate to dupe code, but it's the only work-
196+
//around that I know of at this point :P
168197
break;
169198
case 'x': //send X
170199
bbs.log_key("x");
@@ -562,7 +591,7 @@ msg_base = {
562591
console.putmsg("mBase.last_msg = " + mBase.last_msg + "\n");
563592
}
564593

565-
if (forward) { inc = 1; } else { inc = -1; }
594+
if (forward) {inc = 1;} else {inc = -1;}
566595

567596
// if starting in reverse from the room prompt, unskip one message
568597
if (!forward) tmpPtr += 1; // so we start with the most recently read

0 commit comments

Comments
 (0)