diff --git a/client/components/Windows/Connect.vue b/client/components/Windows/Connect.vue
index 79ce6cc4..11fc5661 100644
--- a/client/components/Windows/Connect.vue
+++ b/client/components/Windows/Connect.vue
@@ -59,16 +59,11 @@ export default {
// When the network is locked, URL overrides should not affect disabled fields
if (
this.$store.state.serverConfiguration.lockNetwork &&
- ["host", "port", "tls", "rejectUnauthorized"].includes(key)
+ ["name", "host", "port", "tls", "rejectUnauthorized"].includes(key)
) {
continue;
}
- // When the network is not displayed, its name in the UI is not customizable
- if (!this.$store.state.serverConfiguration.displayNetwork && key === "name") {
- continue;
- }
-
if (key === "join") {
value = value
.split(",")
diff --git a/defaults/config.js b/defaults/config.js
index 8b99cbee..c43abb83 100644
--- a/defaults/config.js
+++ b/defaults/config.js
@@ -238,25 +238,11 @@ module.exports = {
join: "#thelounge",
},
- // ### `displayNetwork`
- //
- // When set to `false`, network fields will not be shown in the "Connect"
- // window.
- //
- // Note that even though users cannot access and set these fields, they can
- // still connect to other networks using the `/connect` command. See the
- // `lockNetwork` setting to restrict users from connecting to other networks.
- //
- // This value is set to `true` by default.
- displayNetwork: true,
-
// ### `lockNetwork`
//
// When set to `true`, users will not be able to modify host, port and TLS
// settings and will be limited to the configured network.
- //
- // It is often useful to use it with `displayNetwork` when setting The
- // Lounge as a public web client for a specific IRC network.
+ // These fields will also be hidden from the UI.
//
// This value is set to `false` by default.
lockNetwork: false,
diff --git a/src/client.js b/src/client.js
index 6fe569f4..5272863c 100644
--- a/src/client.js
+++ b/src/client.js
@@ -227,7 +227,7 @@ Client.prototype.connect = function (args, isStartup = false) {
const network = new Network({
uuid: args.uuid,
name: String(
- args.name || (Helper.config.displayNetwork ? "" : Helper.config.defaults.name) || ""
+ args.name || (Helper.config.lockNetwork ? Helper.config.defaults.name : "") || ""
),
host: String(args.host || ""),
port: parseInt(args.port, 10),
diff --git a/src/helper.js b/src/helper.js
index 2b691052..fcfe93ff 100644
--- a/src/helper.js
+++ b/src/helper.js
@@ -125,16 +125,6 @@ function setHome(newPath) {
mergeConfig(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.`
- );
- }
-
if (this.config.fileUpload.baseUrl) {
try {
new URL("test/file.png", this.config.fileUpload.baseUrl);
diff --git a/src/models/network.js b/src/models/network.js
index 2d28847e..50695d00 100644
--- a/src/models/network.js
+++ b/src/models/network.js
@@ -120,6 +120,7 @@ Network.prototype.validate = function (client) {
return false;
}
+ this.name = Helper.config.defaults.name;
this.host = Helper.config.defaults.host;
this.port = Helper.config.defaults.port;
this.tls = Helper.config.defaults.tls;
@@ -436,7 +437,7 @@ Network.prototype.exportForEdit = function () {
"commands",
];
- if (Helper.config.displayNetwork) {
+ if (!Helper.config.lockNetwork) {
fieldsToReturn.push("host");
fieldsToReturn.push("port");
fieldsToReturn.push("tls");
diff --git a/src/server.js b/src/server.js
index f2a42917..a4030843 100644
--- a/src/server.js
+++ b/src/server.js
@@ -706,18 +706,12 @@ function initializeClient(socket, client, token, lastMessage, openChannel) {
}
function getClientConfiguration() {
- const config = _.pick(Helper.config, [
- "public",
- "lockNetwork",
- "displayNetwork",
- "useHexIp",
- "prefetch",
- ]);
+ const config = _.pick(Helper.config, ["public", "lockNetwork", "useHexIp", "prefetch"]);
config.fileUpload = Helper.config.fileUpload.enable;
config.ldapEnabled = Helper.config.ldap.enable;
- if (config.displayNetwork) {
+ if (!config.lockNetwork) {
config.defaults = _.clone(Helper.config.defaults);
} else {
// Only send defaults that are visible on the client
diff --git a/test/server.js b/test/server.js
index 374cf584..e1647bba 100644
--- a/test/server.js
+++ b/test/server.js
@@ -113,7 +113,6 @@ describe("Server", function () {
expect(data.defaultTheme).to.equal("default");
expect(data.themes).to.be.an("array");
expect(data.lockNetwork).to.equal(false);
- expect(data.displayNetwork).to.equal(true);
expect(data.useHexIp).to.equal(false);
done();