Fix echomail zone to prefix in ini file. Call atcode parser before rendering frames

This commit is contained in:
Deon George 2022-04-26 21:54:34 +10:00
parent c1980c359e
commit 0214416c4e
7 changed files with 60 additions and 9 deletions

View File

@ -3,17 +3,26 @@
; Our key used to sign frames we send to other systems ; Our key used to sign frames we send to other systems
;gpg_key=0@videotex ;gpg_key=0@videotex
; The prefix configurations need to be kept in sync with other nodes
[sqrl] [sqrl]
auth_url=https://ansitex.bbs.leenooks.net auth_url=https://ansitex.bbs.leenooks.net
auth_path=/sqrl/login auth_path=/sqrl/login
auth_post=/api/sqrl auth_post=/api/sqrl
; The prefix configurations need to be kept in sync with other nodes
; Frames with no specific owner are owned by this key ; Frames with no specific owner are owned by this key
; [prefix:x] - applies to pages begining with x
; key= - the GPG key of the owner (for remote updates)
; user= - the local user that can edit these frames (via *04)
; logoans= - the service providers logo (for ANSI)
; logovtx= - the service providers logo (for VIEWDATA)
; code= - For Echomail, the echoarea tag
; last_page= - For Echomail, the last page tagged
[prefix] [prefix]
key=0@videotex key=0@videotex
logoans=AWgBUkEBR04BQlMBWUkBbgE3AWt0ZXgBbg== logoans=AWgBUkEBR04BQlMBWUkBbgE3AWt0ZXgBbg==
logovtx=AUECTgNTBEkHdGV4 logovtx=AUECTgNTBEkHdGV4
user=1
; System frames are owned by this key ; System frames are owned by this key
[prefix:9] [prefix:9]
@ -28,3 +37,9 @@ key=516@videotex
logoans=AWgBUkEBR04BQlMBWUkBbgE3AWt0ZXgBbg== logoans=AWgBUkEBR04BQlMBWUkBbgE3AWt0ZXgBbg==
logovtx=AUECTgNTBEkHdGV4 logovtx=AUECTgNTBEkHdGV4
user=1 user=1
; Private Net
[prefix:10010]
user=1
logoans=UHJpdmF0ZSBFY2hvYXJlYQ==
logovtx=UHJpdmF0ZU5ldA==

View File

@ -98,12 +98,15 @@ function FrameAnsi() {
contentgraphic = new Graphic(this.settings.FRAME_WIDTH); contentgraphic = new Graphic(this.settings.FRAME_WIDTH);
contentgraphic.auto_extend = true; contentgraphic.auto_extend = true;
contentgraphic.atcodes = false;
contentgraphic.ANSI = this.parse(base64_decode(this.content)); contentgraphic.ANSI = this.parse(base64_decode(this.content));
var contentframe = new Frame(1,2,this.settings.FRAME_WIDTH,this.settings.FRAME_LENGTH,LIGHTGRAY,frame); var contentframe = new Frame(1,2,this.settings.FRAME_WIDTH,this.settings.FRAME_LENGTH,LIGHTGRAY,frame);
contentframe.open(); contentframe.open();
contentframe.lf_strict = false; contentframe.lf_strict = false;
contentframe.atcodes = true; contentframe.atcodes = false;
contentframe.word_wrap = false
contentframe.putmsg(contentgraphic.MSG) contentframe.putmsg(contentgraphic.MSG)
contentframe.scrollTo(0,0); contentframe.scrollTo(0,0);

View File

@ -528,5 +528,12 @@ PageFrame.prototype.parse = function(text) {
*/ */
} }
// Convert any atcodes
output = output.replace(/@(.*)@/g,
function (str, code, offset, s) {
return bbs.atcode(code);
}
);
return output; return output;
}; };

View File

@ -1,8 +1,6 @@
// Array of page owners // Array of page owners
pageowners = []; pageowners = [];
load('graphic.js');
// String repeat. // String repeat.
if (!String.prototype.repeat) { if (!String.prototype.repeat) {
String.prototype.repeat = function(count) { String.prototype.repeat = function(count) {
@ -45,7 +43,8 @@ if (!String.prototype.repeat) {
return rpt; return rpt;
}; };
} }
/*
// Cant enable this - problem with frame.js, line 451. c.open not a function
// Group By // Group By
if (!Array.prototype.groupby) { if (!Array.prototype.groupby) {
Array.prototype.groupby = function(prop) { Array.prototype.groupby = function(prop) {
@ -58,6 +57,29 @@ if (!Array.prototype.groupby) {
}; };
} }
if (!Array.prototype.min) {
Array.prototype.min = function() {
return this[0];
}
}
if (!Array.prototype.max) {
Array.prototype.max = function() {
return this.reverse()[0];
}
}
if (!Array.prototype.pluck) {
Array.prototype.pluck = function(item) {
var pluck = [];
for(var x in this) {
if (this[x][item])
pluck.push(this[x][item]);
}
return pluck;
}
}
*/
/** /**
* Convert ANSI into BIN for loading into a Frame * Convert ANSI into BIN for loading into a Frame
* *

View File

@ -133,7 +133,7 @@ function MsgArea() {
exit(2); exit(2);
} }
var page = f.iniGetValue('zone:'+this.page_prefix,PAGE_LAST_KEY) var page = f.iniGetValue('prefix:'+this.page_prefix,PAGE_LAST_KEY)
f.close(); f.close();
return page ? page : '0'.repeat(PAGE_LENGTH); return page ? page : '0'.repeat(PAGE_LENGTH);
@ -146,7 +146,7 @@ function MsgArea() {
exit(2); exit(2);
} }
f.iniSetValue('zone:'+this.page_prefix,PAGE_LAST_KEY,(''+page).padStart(4,'0')); f.iniSetValue('prefix:'+this.page_prefix,PAGE_LAST_KEY,(''+page).padStart(4,'0'));
f.close(); f.close();
} }
}); });

View File

@ -8,10 +8,14 @@ require('text.js','TOTAL_TEXT');
require('key_defs.js','KEY_ESC'); require('key_defs.js','KEY_ESC');
ansi = load({},'ansiterm_lib.js'); ansi = load({},'ansiterm_lib.js');
load('frame.js');
load('graphic.js');
// Ansitex specific includes
load('ansitex/load/funcs.js'); load('ansitex/load/funcs.js');
load('ansitex/load/msgbases.js'); load('ansitex/load/msgbases.js');
// Ansitex specific includes
require('ansitex/load/defs.js','ACTION_EXIT'); require('ansitex/load/defs.js','ACTION_EXIT');
require('ansitex/load/frame-ansi.js','FRAME_ANSI'); require('ansitex/load/frame-ansi.js','FRAME_ANSI');
require('ansitex/load/frame-viewdata.js','FRAME_VIEWDATA'); require('ansitex/load/frame-viewdata.js','FRAME_VIEWDATA');

View File

@ -1 +1 @@
{"version":1,"frame":98,"index":"a","owner":9,"cost":0,"content":"G1swbRtbNzFDG1sxOzMybRtYbm9kZWlkOzgbXBtbMG0NChtbNTVDG1sxbUBEQVRFVElNRUAbWzBtDQobWzIyQxtbMW3aIL/Cv7Pav9q/2sK/wr8bWzBtIBtbMW3DLdq/G1swbQ0KG1syMkOzs7PD2bOzILOzsyCzw9kbWzMwbdsbWzM3bbMgs7MNChtbMjJDG1sxOzMwbcDB2cHZwMDZwNnAINnB2RtbMG0gG1sxOzMwbcDZwNkbWzBtIBtbMTszMG36+vobWzBtDQobWzIyQxtbMTszMG3ExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMQbWzBtDQobWzIzQxtbMTszMW3c3MTcG1szN20gG1szMm3c3MTcG1szN20gG1szNG3c3MTcG1szN20gG1szM23c3BtbMG0gG1szMDs0N20g3NwgICDc3MTcINzcINwgG1szNzs0MG0NChtbMjNDG1sxOzMxbdzcxLEbWzM3bSAbWzMybbKxG1szN20gG1szMm2xG1szN20gG1szNG3f38TcG1szN20gG1szM23c3BtbMG0gG1szMDs0N20gsrHEICCyscTfIN/fwt8gG1szNzs0MG0NChtbMjNDG1sxOzMxbbGwG1swbSAbWzE7MzFtsBtbMG0gG1sxOzMybbGwG1swbSAbWzE7MzJtsBtbMG0gG1sxOzM0bbGwG1swbSAbWzE7MzRtsBtbMG0gG1sxOzMzbbGwG1swbSAbWzMwOzQ3bSCxsCCwILGwILAgsbAgsCAbWzM3OzQwbQ0KG1syM0MbWzE7MzFt39/E3xtbMG0gG1sxOzMybd/fG1swbSAbWzE7MzJt3xtbMG0gG1sxOzM0bd/fxN8bWzBtIBtbMTszM23f3xtbMG0gG1szMDs0N20g39/E3yDf38TfIN/fIN8gG1szNzs0MG0NChtbMjJDG1sxOzMwbcTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExBtbMG0NChtbNEMbWzFtLiAgICAgLiAgIBtbMzBtsxtbMG0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAbWzE7MzBtsxtbMG0NChtbMkMbWzFt2r+/wr/avyC/2r8bWzBtIBtbMTszMG2zG1swbSAbWzE7MzFtVVNFUjobWzBtIBtbMW0bX1VTRVI7MjV0O/kbXBtbMG0gICAgICAgICAgICAgICAgG1sxOzMwbbMbWzBtDQobWzJDwL+zs7OzsyCzs7MgG1sxOzMwbbMbWzBtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgG1sxOzMwbbMbWzBtDQobWzJDG1sxOzMwbcDZ2cG02dkbWzM3bSAbWzMwbdnZ2RtbMzdtIBtbMzBtsxtbMG0gG1sxOzMxbVBBU1M6G1swbSAbWzFtG19QQVNTOzQwcDv5G1wbWzBtIBtbMTszMG2zG1swbQ0KG1s1QxtbMTszMG3E2RtbMG0gICAgICAgG1sxOzMwbbMbWzBtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgG1sxOzMwbbMbWzBtDQoNCg0KDQoNChtbMTNDG1sxOzMwbVRvIHJlZ2lzdGVyIGFuIGFjY291bnQgZW50ZXIbWzBtIBtbMW1ORVcbWzBtIBtbMTszMG1mb3IgdGhlIHVzZXIgbmFtZRtbMG0NChtbMTZDG1sxOzMwbVVzZRtbMG0gG1sxOzMybSoqG1swbSAbWzE7MzBtdG8gY2xlYXIgeW91ciBpbnB1dBtbMG0gG1sxOzMybSowMBtbMG0gG1sxOzMwbXRvIHN0YXJ0IGFnYWluG1swbQ0K","isPublic":1,"isAccessible":1,"type":"l","key":[null,"login",null,null,null,null,null,null,null,null],"date":"2020-07-08T05:17:35.174Z"} {"version":1,"frame":98,"index":"a","owner":9,"cost":0,"content":"G1swbRtbNzFDG1sxOzMybRtYbm9kZWlkOzgbXBtbMG0NChtbNTVDG1sxbUBEQVRFVElNRUAbWzBtDQobWzIyQxtbMW3aIL/Cv7Pav9q/2sK/wr8gwy3avxtbMG0NChtbMjJDs7Ozw9mzsyCzs7Mgs8PZILMgs7MNChtbMjJDG1sxOzMwbcDB2cHZwMDZwNnAINnB2SDA2cDZIPr6+htbMG0NChtbMjJDG1sxOzMwbcTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExBtbMG0NChtbMjNDG1sxOzMxbdzcxNwbWzM3bSAbWzMybdzcxNwbWzM3bSAbWzM0bdzcxNwbWzM3bSAbWzMzbdzcG1swbSAbWzMwOzQ3bSDc3CAgINzcxNwg3Nwg3CAbWzM3OzQwbQ0KG1syM0MbWzE7MzFt3NzEsRtbMzdtIBtbMzJtsrEbWzM3bSAbWzMybbEbWzM3bSAbWzM0bd/fxNwbWzM3bSAbWzMzbdzcG1swbSAbWzMwOzQ3bSCyscQgILKxxN8g39/C3yAbWzM3OzQwbQ0KG1syM0MbWzE7MzFtsbAbWzBtIBtbMTszMW2wG1swbSAbWzE7MzJtsbAbWzBtIBtbMTszMm2wG1swbSAbWzE7MzRtsbAbWzBtIBtbMTszNG2wG1swbSAbWzE7MzNtsbAbWzBtIBtbMzA7NDdtILGwILAgsbAgsCCxsCCwIBtbMzc7NDBtDQobWzIzQxtbMTszMW3f38TfG1swbSAbWzE7MzJt398bWzBtIBtbMTszMm3fG1swbSAbWzE7MzRt39/E3xtbMG0gG1sxOzMzbd/fG1swbSAbWzMwOzQ3bSDf38TfIN/fxN8g398g3yAbWzM3OzQwbQ0KG1syMkMbWzE7MzBtxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEG1swbQ0KG1s0QxtbMW0uICAgICAuICAgG1szMG2zG1swbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBtbMTszMG2zG1swbQ0KG1syQxtbMW3av7/Cv9q/IL/avxtbMG0gG1sxOzMwbbMbWzBtIBtbMTszMW1VU0VSOhtbMG0gG1sxbRtfVVNFUjsyNXQ7+RtcG1swbSAgICAgICAgICAgICAgICAbWzE7MzBtsxtbMG0NChtbMkPAv7Ozs7OzILOzsyAbWzE7MzBtsxtbMG0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAbWzE7MzBtsxtbMG0NChtbMkMbWzE7MzBtwNnZwbTZ2RtbMzdtIBtbMzBt2dnZG1szN20gG1szMG2zG1swbSAbWzE7MzFtUEFTUzobWzBtIBtbMW0bX1BBU1M7NDBwO/kbXBtbMG0gG1sxOzMwbbMbWzBtDQobWzVDG1sxOzMwbcTZG1swbSAgICAgICAbWzE7MzBtsxtbMG0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAbWzE7MzBtsxtbMG0NCg0KDQoNCg0KG1sxM0MbWzE7MzBtVG8gcmVnaXN0ZXIgYW4gYWNjb3VudCBlbnRlchtbMG0gG1sxbU5FVxtbMG0gG1sxOzMwbWZvciB0aGUgdXNlciBuYW1lG1swbQ0KG1sxNkMbWzE7MzBtVXNlG1swbSAbWzE7MzJtKiobWzBtIBtbMTszMG10byBjbGVhciB5b3VyIGlucHV0G1swbSAbWzE7MzJtKjAwG1swbSAbWzE7MzBtdG8gc3RhcnQgYWdhaW4bWzBtDQo=","isPublic":1,"isAccessible":1,"type":"l","key":[null,"login",null,null,null,null,null,null,null,null],"date":"2020-07-08T05:17:35.174Z"}