Skip to content
Snippets Groups Projects
Commit cf8a5ede authored by echicken's avatar echicken
Browse files

If domain_DomainName key exists in modopts.ini (where DomainName is a

domain name from sbbsecho.ini), use its value as the domain name in the
lightbar list.
For nodelist_DomainName keys, use the DomainName portion as the domain
name in the lightbar list.
(Don't use the parsed domain name from the nodelist file's first line,
this is unreliable.)
parent 2b598ada
No related branches found
No related tags found
No related merge requests found
......@@ -155,20 +155,20 @@ function populate_zone_tree(filename, tree, settings) {
});
}
function populate_domain_tree(filename, tree, settings) {
function populate_domain_tree(filename, domain, tree, settings) {
try {
const nodelist = new NodeList(filename);
} catch (err) {
log(LOG_ERR, format('Error parsing %s: %s', filename, err));
return;
}
const domain_tree = tree.addTree(nodelist.domain);
const domain_tree = tree.addTree(domain);
const idx = tree.items.length - 1;
domain_tree.onOpen = function () {
populate_zone_tree(filename, domain_tree, settings);
if (settings.auto_close_domain) {
tree.items.forEach(function (e) {
if (e.text != nodelist.domain) {
if (e.text != domain_tree.text) {
e.close();
e.index = -1;
}
......@@ -185,11 +185,13 @@ function populate_tree(tree, settings) {
const ftn_domains = new FTNDomains();
Object.keys(ftn_domains.nodeListFN).forEach(function (e) {
if (!file_exists(ftn_domains.nodeListFN[e])) return;
populate_domain_tree(ftn_domains.nodeListFN[e], tree, settings);
const dn = settings['domain_' + e] || e;
populate_domain_tree(ftn_domains.nodeListFN[e], dn, tree, settings);
});
Object.keys(settings).forEach(function (e) {
if (e.search(/^nodelist_/) > -1 && file_exists(settings[e])) {
populate_domain_tree(settings[e], tree, settings);
const dn = e.replace(/^nodelist_/, '');
populate_domain_tree(settings[e], dn, tree, settings);
}
});
tree.items.sort(function (a, b) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment