Correctly verify channel settings on chset
This commit is contained in:
parent
621131699d
commit
5bf307482e
|
@ -327,6 +327,7 @@ export class Channel extends EventEmitter {
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// TODO Cleanup
|
||||||
if (
|
if (
|
||||||
typeof set.color == "string" &&
|
typeof set.color == "string" &&
|
||||||
(typeof set.color2 == "undefined" ||
|
(typeof set.color2 == "undefined" ||
|
||||||
|
@ -352,6 +353,17 @@ export class Channel extends EventEmitter {
|
||||||
|
|
||||||
if (this.isLobby() && !admin) return;
|
if (this.isLobby() && !admin) return;
|
||||||
|
|
||||||
|
// Validate settings in set
|
||||||
|
const validatedSet = validateChannelSettings(set);
|
||||||
|
|
||||||
|
// Set the verified settings
|
||||||
|
for (const key of Object.keys(validatedSet)) {
|
||||||
|
this.logger.debug(`${key}: ${(validatedSet as any)[key]}`);
|
||||||
|
if ((validatedSet as any)[key] === false) continue;
|
||||||
|
(this.settings as any)[key] = (set as any)[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// Verify settings
|
// Verify settings
|
||||||
const validSettings = validateChannelSettings(set);
|
const validSettings = validateChannelSettings(set);
|
||||||
|
|
||||||
|
@ -364,6 +376,7 @@ export class Channel extends EventEmitter {
|
||||||
)[key];
|
)[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
this.emit("update", this);
|
this.emit("update", this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue