Merge pull request #2702 from thelounge/astorije/connect-override

Fix bugs with URL overrides in Connect window
This commit is contained in:
Pavel Djundik 2018-08-15 11:40:11 +03:00 committed by GitHub
commit c9ba896d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -176,6 +176,17 @@ function parseOverrideParams(params, data) {
continue;
}
// When the network is locked, URL overrides should not affect disabled fields
if (data.lockNetwork &&
["host", "port", "tls", "rejectUnauthorized"].includes(key)) {
continue;
}
// When the network is not displayed, its name in the UI is not customizable
if (!data.displayNetwork && key === "name") {
continue;
}
if (key === "join") {
value = value.split(",").map((chan) => {
if (!chan.match(/^[#&!+]/)) {

View File

@ -590,6 +590,7 @@ function getClientConfiguration(network) {
} else {
// Only send defaults that are visible on the client
config.defaults = _.pick(network || Helper.config.defaults, [
"name",
"nick",
"username",
"password",