Customizable server name
Read server name from config if "name" is present.
This commit is contained in:
parent
2f5be12d00
commit
41837210e1
|
@ -74,7 +74,8 @@ Client.prototype.connect = function(args) {
|
||||||
var client = this;
|
var client = this;
|
||||||
var server = {
|
var server = {
|
||||||
host: args.host || "irc.freenode.org",
|
host: args.host || "irc.freenode.org",
|
||||||
port: args.port || 6667
|
port: args.port || 6667,
|
||||||
|
name: args.name
|
||||||
};
|
};
|
||||||
|
|
||||||
var stream = args.tls ? tls.connect(server) : net.connect(server);
|
var stream = args.tls ? tls.connect(server) : net.connect(server);
|
||||||
|
@ -92,6 +93,7 @@ Client.prototype.connect = function(args) {
|
||||||
|
|
||||||
var network = new Network({
|
var network = new Network({
|
||||||
host: server.host,
|
host: server.host,
|
||||||
|
name: server.name,
|
||||||
irc: irc
|
irc: irc
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,9 @@ function Network(attr) {
|
||||||
connected: false,
|
connected: false,
|
||||||
host: "",
|
host: "",
|
||||||
id: id++,
|
id: id++,
|
||||||
irc: null,
|
irc: null
|
||||||
name: prettify(attr.host)
|
|
||||||
}, attr));
|
}, attr));
|
||||||
|
this.name = attr.name || prettify(attr.host);
|
||||||
this.channels.unshift(
|
this.channels.unshift(
|
||||||
new Chan({name: this.name, type: Chan.Type.LOBBY})
|
new Chan({name: this.name, type: Chan.Type.LOBBY})
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue