mirror of
https://github.com/thelounge/thelounge
synced 2024-12-03 17:29:14 +00:00
Prevent private mode when no user exists
This commit is contained in:
parent
cb4b6786b2
commit
656900448b
1 changed files with 7 additions and 7 deletions
|
@ -13,7 +13,13 @@ program
|
|||
.description("Start the server")
|
||||
.action(function() {
|
||||
var users = new ClientManager().getUsers();
|
||||
if (!config.public && !users.length) {
|
||||
var mode = config.public;
|
||||
if (program.public) {
|
||||
mode = true;
|
||||
} else if (program.private) {
|
||||
mode = false;
|
||||
}
|
||||
if (!mode && !users.length) {
|
||||
console.log("");
|
||||
console.log("No users found!");
|
||||
console.log("Create a new user with 'shout add <name>'.");
|
||||
|
@ -21,12 +27,6 @@ program
|
|||
} else {
|
||||
var host = program.host || process.env.IP || config.host;
|
||||
var port = program.port || process.env.PORT || config.port;
|
||||
var mode = config.public;
|
||||
if (program.public) {
|
||||
mode = true;
|
||||
} else if (program.private) {
|
||||
mode = false;
|
||||
}
|
||||
shout(port, host, mode);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue