Merge pull request #1211 from thelounge/xpaw/fix-default-network-name

Fix network name not being set when displayNetwork is false
This commit is contained in:
Jérémie Astori 2017-06-08 19:59:41 -04:00 committed by GitHub
commit 5a3b9cf969
2 changed files with 8 additions and 1 deletions

View file

@ -187,7 +187,7 @@ Client.prototype.connect = function(args) {
args.hostname = args.hostname || (client.config && client.config.hostname) || client.hostname; args.hostname = args.hostname || (client.config && client.config.hostname) || client.hostname;
var network = new Network({ var network = new Network({
name: args.name || "", name: (config.displayNetwork ? args.name : config.defaults.name) || "",
host: args.host || "", host: args.host || "",
port: parseInt(args.port, 10) || (args.tls ? 6697 : 6667), port: parseInt(args.port, 10) || (args.tls ? 6697 : 6667),
tls: !!args.tls, tls: !!args.tls,

View file

@ -7,6 +7,7 @@ var os = require("os");
var fs = require("fs"); var fs = require("fs");
var net = require("net"); var net = require("net");
var bcrypt = require("bcryptjs"); var bcrypt = require("bcryptjs");
const colors = require("colors/safe");
var Helper = { var Helper = {
config: null, config: null,
@ -68,6 +69,12 @@ function setHome(homePath) {
this.config = _.extend(this.config, userConfig); this.config = _.extend(this.config, userConfig);
} }
if (!this.config.displayNetwork && !this.config.lockNetwork) {
this.config.lockNetwork = true;
log.warn(`${colors.bold("displayNetwork")} and ${colors.bold("lockNetwork")} are false, setting ${colors.bold("lockNetwork")} to true.`);
}
// TODO: Remove in future release // TODO: Remove in future release
if (this.config.debug === true) { if (this.config.debug === true) {
log.warn("debug option is now an object, see defaults file for more information."); log.warn("debug option is now an object, see defaults file for more information.");