Compare commits
1 Commits
e72ffdc8a4
...
b2153e30f3
Author | SHA1 | Date | |
---|---|---|---|
b2153e30f3 |
@ -15,6 +15,7 @@ const FRAMES_HOME = ANSITEX_HOME+'/text/';
|
||||
const FRAMES_MSG_BASE = 'vtx_data';
|
||||
/* Load frames from files */
|
||||
const FRAMES_MSG_FILES = true;
|
||||
const FRAMES_EOF_MARKER = "\r\n=== EOF";
|
||||
|
||||
const PAGE_LENGTH = 4; // The size of our page tag as stored in the msgbase for echomail/netmail
|
||||
const NUMERIC_REGEX = /^[0-9]*$/;
|
||||
|
@ -163,7 +163,7 @@ function MsgArea() {
|
||||
var headers = msgbase.get_all_msg_headers(false,false) || [];
|
||||
|
||||
for (var i in headers) {
|
||||
if ((! (headers[i].attr&MSG_DELETE)) && headers[i].tags && ((! regex) || regex.test(headers[i].tags)))
|
||||
if ((! (headers[i].attr&MSG_DELETE)) && (headers[i].from === 'SYSTEM') && ((! regex) || regex.test(headers[i].to)))
|
||||
frames.push(headers[i]);
|
||||
}
|
||||
|
||||
@ -426,10 +426,13 @@ function MsgArea() {
|
||||
var raw = msgbase.get_msg_body(false,id,false,false,true,true);
|
||||
|
||||
// Our messages are terminated with \r=== EOF
|
||||
if (! /^(.*)\r=== EOF/.test(raw))
|
||||
var regex = new RegExp('^(.*)'+FRAMES_EOF_MARKER);
|
||||
if (! regex.test(raw))
|
||||
return undefined;
|
||||
|
||||
var content = JSON.parse(LZString.decompressFromBase64(raw.replace(/\r=== EOF[.\s\S]*$/,'')));
|
||||
var regex = new RegExp(FRAMES_EOF_MARKER+'[.\\s\\S]*$');
|
||||
|
||||
var content = JSON.parse(LZString.decompressFromBase64(raw.replace(regex,'')));
|
||||
msgbase.close();
|
||||
|
||||
} else {
|
||||
|
@ -110,8 +110,6 @@ require('sbbsdefs.js','SS_USERON'); // Need for our ANSI colors eg: BG_*
|
||||
* - load - Load the frame from the msgbase
|
||||
*/
|
||||
function Page(debug) {
|
||||
const EOF_MARKER = "\r=== EOF";
|
||||
|
||||
this.__window__ = {
|
||||
layout: undefined, // Window - Full page content
|
||||
header: undefined, // Window - Page Title
|
||||
@ -920,7 +918,7 @@ function Page(debug) {
|
||||
this.name = page;
|
||||
|
||||
// Load a page from disk first if it exists
|
||||
if (FRAMES_MSG_FILES && this.import(FRAMES_HOME+page.toString(),SESSION_EXT))
|
||||
if (false && FRAMES_MSG_FILES && this.import(FRAMES_HOME+page.toString(),SESSION_EXT))
|
||||
return true;
|
||||
|
||||
// Fall back to loading from msgbase
|
||||
@ -1043,7 +1041,7 @@ function Page(debug) {
|
||||
return a.number < b.number
|
||||
else
|
||||
return (a.when_imported_time < b.when_imported_time); })
|
||||
.filter(function(item) { return item.tags === page; }).pop();
|
||||
.filter(function(item) { return (item.from === 'SYSTEM') && (item.to === page); }).pop();
|
||||
|
||||
if (msg === undefined) {
|
||||
log(LOG_DEBUG,'|- Frame not found: ['+page.toString()+'] in ['+FRAMES_MSG_BASE+']');
|
||||
@ -1307,7 +1305,7 @@ function Page(debug) {
|
||||
'content': p.raw,
|
||||
};
|
||||
|
||||
var body = LZString.compressToBase64(JSON.stringify(page))+EOF_MARKER;
|
||||
var body = LZString.compressToBase64(JSON.stringify(page))+FRAMES_EOF_MARKER;
|
||||
|
||||
if (! msgbase.save_msg(hdr,body)) {
|
||||
log(LOG_ERROR,' ! Error saving frame: ['+this.name.toString()+']');
|
||||
|
Loading…
Reference in New Issue
Block a user