Skip to content
Snippets Groups Projects
Commit ed2444f5 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Optional channel list per server configured in modopts.ini

So you have multiple IRC servers configured in modopts.ini and
you want different channel list per server? Just add more
keys to the modopts.ini [chat_sec] section of the form:
<server>=<channel_list>

Where <server> is the IRC server's host name (e.g. irc.synchro.net)
and <channel_list> is a comma-separated list of channels to override
the default list of channels (set with the "irc_channel" key).

For DesotoFireflite (VALHALLA)
parent 1dfb8c00
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -109,19 +109,26 @@ while(bbs.online && !console.aborted) {
if(console.aborted || server.length < 4)
break;
}
if(server.indexOf(' ') < 0)
server += " 6667";
if(irc_channels.length > 1) {
for(var i = 0; i < irc_channels.length; i++)
console.uselect(i, "IRC Channel", irc_channels[i]);
// Optional list of channels per server (e.g. irc.synchro.net = #synchronet, #bbs)
var channel_list = irc_channels;
if(options[server] !== undefined)
channel_list = options[server].split(',');
var channel;
if(channel_list.length > 1) {
for(var i = 0; i < channel_list.length; i++) {
channel_list[i] = channel_list[i].trim();
console.uselect(i, "IRC Channel", channel_list[i]);
}
var i = console.uselect();
if(i < 0)
break;
channel = irc_channels[i];
channel = channel_list[i];
} else {
write("\r\n\x01n\x01y\x01hIRC Channel: ");
var channel = console.getstr(options.irc_channel, 40, K_EDIT|K_LINE|K_AUTODEL);
channel = console.getstr(channel_list[0], 40, K_EDIT|K_LINE|K_AUTODEL);
}
if(server.indexOf(' ') < 0)
server += " 6667";
if(!console.aborted && channel.length) {
log("IRC to " + server + " " + channel);
bbs.exec("?irc -a " + server + " " + channel); // can't be load()ed because it calls exit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment