Check that CHANTYPES and PREFIX are set, and set defaults

This commit is contained in:
Pavel Djundik 2018-10-13 13:54:32 +03:00
parent 71b3acb152
commit a4ec875c87
2 changed files with 10 additions and 4 deletions

View File

@ -40,8 +40,8 @@ function Network(attr) {
hostname: null,
irc: null,
serverOptions: {
CHANTYPES: [],
PREFIX: [],
CHANTYPES: ["#", "&"],
PREFIX: ["!", "@", "%", "+"],
NETWORK: "",
},
chanCache: [],

View File

@ -149,8 +149,14 @@ module.exports = function(irc, network) {
network.prefixLookup[mode.mode] = mode.symbol;
});
network.serverOptions.CHANTYPES = data.options.CHANTYPES;
network.serverOptions.PREFIX = data.options.PREFIX.map((p) => p.symbol);
if (data.options.CHANTYPES) {
network.serverOptions.CHANTYPES = data.options.CHANTYPES;
}
if (network.serverOptions.PREFIX) {
network.serverOptions.PREFIX = data.options.PREFIX.map((p) => p.symbol);
}
network.serverOptions.NETWORK = data.options.NETWORK;
client.emit("network:options", {