Skip to content
Snippets Groups Projects
Commit 8ef6b662 authored by rswindell's avatar rswindell
Browse files

Support the "areatitle_prefix" and "handles" keys.

Requires the latest SCFG with the new "-misc=<val>" option.
parent ded7e89d
No related branches found
No related tags found
No related merge requests found
...@@ -18,10 +18,12 @@ ...@@ -18,10 +18,12 @@
; host = Internet hostname or IP address of the preferred hub BinkP server ; host = Internet hostname or IP address of the preferred hub BinkP server
; port = TCP port number of the preferred hub BinkP server (if not 24554) ; port = TCP port number of the preferred hub BinkP server (if not 24554)
; dns = Suffix for f<node>.n<net>.z<zone>.<suffix> DNS-based address look-ups ; dns = Suffix for f<node>.n<net>.z<zone>.<suffix> DNS-based address look-ups
; handles = Set to true to specify that the network does not require real names
; areamgr = Recipient of remote area management request NetMail messages ; areamgr = Recipient of remote area management request NetMail messages
; echolist = HTTP[S] URL to an EchoList in BACKBONE.NA format, or just filename ; echolist = HTTP[S] URL to an EchoList in BACKBONE.NA format, or just filename
; areatag_prefix = If the EchoList uses a common AreaTag prefix, this is it ; areatag_prefix = If the EchoList uses a common Area Tag prefix, this is it
; areatag_exclude = Comma-separated list of AreaTags to exclude from EchoList ; areatag_exclude = Comma-separated list of Area Tags to exclude from EchoList
; areatitle_prefix = If every Area Title includes a prefix, this is it
[zone:1] [zone:1]
name = FidoNet name = FidoNet
...@@ -69,6 +71,7 @@ addr = 39:39/0 ...@@ -69,6 +71,7 @@ addr = 39:39/0
fido = 2:280/464 fido = 2:280/464
host = fido.vlzn.nl host = fido.vlzn.nl
echolist = http://www.vlzn.nl/AmigaNet/AmigaNetEchomailAreas.na echolist = http://www.vlzn.nl/AmigaNet/AmigaNetEchomailAreas.na
areatitle_prefix = AmigaNet:
[zone:44] [zone:44]
name = DoRENET name = DoRENET
...@@ -78,7 +81,6 @@ coord = Dream Master ...@@ -78,7 +81,6 @@ coord = Dream Master
addr = 1:218/530 addr = 1:218/530
addr = 44:100/0 addr = 44:100/0
handles = true handles = true
realname = false
echolist = DORENET.NA echolist = DORENET.NA
areatag_prefix = DN_ areatag_prefix = DN_
areatag_exclude = netmail areatag_exclude = netmail
...@@ -92,6 +94,7 @@ email = accessd@pharcyde.org ...@@ -92,6 +94,7 @@ email = accessd@pharcyde.org
addr = 46:1/100 addr = 46:1/100
fido = 1:154/700 fido = 1:154/700
host = pharcyde.org host = pharcyde.org
handles = true
echolist = agoranet.na echolist = agoranet.na
areatag_prefix = AGN_ areatag_prefix = AGN_
...@@ -120,6 +123,7 @@ fido = 1:229/101 ...@@ -120,6 +123,7 @@ fido = 1:229/101
dns = scinet-ftn.org dns = scinet-ftn.org
echolist = https://scinet-ftn.org/scinet.na echolist = https://scinet-ftn.org/scinet.na
areatag_prefix = areatag_prefix =
areatitle_prefix = SciNet:
[zone:432] [zone:432]
name = VKRadio name = VKRadio
......
...@@ -97,6 +97,34 @@ function remove_lines_from_file(filename, patterns, maxlinelen) ...@@ -97,6 +97,34 @@ function remove_lines_from_file(filename, patterns, maxlinelen)
return result; return result;
} }
function remove_prefix_from_title(filename, prefix)
{
var file = new File(filename);
if(!file.open("r"))
return "Error " + file.error + " opening " + file.name;
var lines = file.readAll(1000);
file.close();
var longest = 0;
var list = [];
for(var i = 0; i < lines.length; i++) {
var a = lines[i].split(/\s+/);
var tag = a.shift();
if(tag.length > longest)
longest = tag.length;
var title = a.join(' ');
if(title.toLowerCase().indexOf(prefix.toLowerCase()) == 0)
title = title.substr(prefix.length);
list.push({ tag: tag, title: title});
}
var file = new File(filename);
if(!file.open("w"))
return "Error " + file.error + " opening " + file.name;
for(var i in list)
file.writeln(format("%-*s %s", longest, list[i].tag, list[i].title));
file.close();
return true;
}
function find_sys_addr(addr) function find_sys_addr(addr)
{ {
for(var i = 0; i < system.fido_addr_list.length; i++) { for(var i = 0; i < system.fido_addr_list.length; i++) {
...@@ -332,7 +360,7 @@ if(!netzone) { ...@@ -332,7 +360,7 @@ if(!netzone) {
var which; var which;
while((!which || which < 1) && !aborted()) { while((!which || which < 1) && !aborted()) {
var str = prompt("Which or [Q]uit"); var str = prompt("Which or [Q]uit");
if(str.toUpperCase() == 'Q') if(str && str.toUpperCase() == 'Q')
exit(0); exit(0);
which = parseInt(str, 10); which = parseInt(str, 10);
} }
...@@ -586,12 +614,23 @@ if(echolist_fname && file_size(echolist_fname) > 0) { ...@@ -586,12 +614,23 @@ if(echolist_fname && file_size(echolist_fname) > 0) {
if(result !== true) if(result !== true)
alert(result); alert(result);
} }
if(network.areatitle_prefix) {
print("Removing " + network.areatitle_prefix + " Title Prefixes from " + echolist_fname);
var result = remove_prefix_from_titles(echolist_fname, network.areatitle_prefix);
if(result !== true)
alert(result);
}
if(confirm("Import EchoList (" + echolist_fname + ") into Message Group: " + netname)) { if(confirm("Import EchoList (" + echolist_fname + ") into Message Group: " + netname)) {
print("Importing " + echolist_fname); print("Importing " + echolist_fname);
var misc = 0;
if(!network.handles)
misc |= SUB_NAME;
system.exec(system.exec_dir + "scfg" system.exec(system.exec_dir + "scfg"
+ " -import=" + echolist_fname + " -import=" + echolist_fname
+ " -g" + netname + " -g" + netname
+ " -faddr=" + fidoaddr.to_str(your)); + " -faddr=" + fidoaddr.to_str(your)
+ " -misc=" + misc
);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment