From f06de70c4075414b6e5287bf6da432c09fa94f34 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 6 Jul 2017 15:02:32 +0300 Subject: [PATCH] Remove hostname prettifier --- src/models/network.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/models/network.js b/src/models/network.js index 4a63d355..6c7bc9a8 100644 --- a/src/models/network.js +++ b/src/models/network.js @@ -30,7 +30,10 @@ function Network(attr) { chanCache: [], }); - this.name = attr.name || prettify(attr.host); + if (!this.name) { + this.name = this.host; + } + this.channels.unshift( new Chan({ name: this.name, @@ -103,17 +106,3 @@ Network.prototype.getChannel = function(name) { return that.name.toLowerCase() === name; }); }; - -function prettify(host) { - var name = capitalize(host.split(".")[1]); - if (!name) { - name = host; - } - return name; -} - -function capitalize(str) { - if (typeof str === "string") { - return str.charAt(0).toUpperCase() + str.slice(1); - } -}