mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-11-22 16:56:16 +00:00
Changed the order of code in CommandLineController to allow login when no database is present yet. Duh.
This commit is contained in:
parent
5328df65b3
commit
9693371a3d
@ -79,8 +79,7 @@ public class CommandLineController {
|
||||
try {
|
||||
logger.info("Initializing UserManager");
|
||||
UserManager.init(client);
|
||||
Database.init(client);
|
||||
|
||||
|
||||
UserManager user = UserManager.getInstance();
|
||||
|
||||
if (!CommandLineOptions.cmd_login && !user.isLoggedIn()) {
|
||||
@ -93,7 +92,19 @@ public class CommandLineController {
|
||||
throw new RuntimeException("Account / User mismatch");
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("CommandLineOptions.cmd_login: {}", CommandLineOptions.cmd_login);
|
||||
if (CommandLineOptions.cmd_login) {
|
||||
cmd_login(account);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
// If we reach this point, we can assume that there is an account and a database can be loaded / created.
|
||||
|
||||
Database.init(client);
|
||||
|
||||
|
||||
|
||||
if (CommandLineOptions.cmd_stats) {
|
||||
cmd_stats();
|
||||
System.exit(0);
|
||||
@ -120,11 +131,7 @@ public class CommandLineController {
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("CommandLineOptions.cmd_login: {}", CommandLineOptions.cmd_login);
|
||||
if (CommandLineOptions.cmd_login) {
|
||||
cmd_login(account);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
if (user.isLoggedIn()) {
|
||||
System.out.println("You are logged in as " + Utils.anonymize(user.getUserString()));
|
||||
|
Loading…
Reference in New Issue
Block a user