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 server = {
|
||||
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);
|
||||
|
@ -92,6 +93,7 @@ Client.prototype.connect = function(args) {
|
|||
|
||||
var network = new Network({
|
||||
host: server.host,
|
||||
name: server.name,
|
||||
irc: irc
|
||||
});
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ function Network(attr) {
|
|||
connected: false,
|
||||
host: "",
|
||||
id: id++,
|
||||
irc: null,
|
||||
name: prettify(attr.host)
|
||||
irc: null
|
||||
}, attr));
|
||||
this.name = attr.name || prettify(attr.host);
|
||||
this.channels.unshift(
|
||||
new Chan({name: this.name, type: Chan.Type.LOBBY})
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue