mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-11-23 01:06:17 +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,7 +79,6 @@ public class CommandLineController {
|
|||||||
try {
|
try {
|
||||||
logger.info("Initializing UserManager");
|
logger.info("Initializing UserManager");
|
||||||
UserManager.init(client);
|
UserManager.init(client);
|
||||||
Database.init(client);
|
|
||||||
|
|
||||||
UserManager user = UserManager.getInstance();
|
UserManager user = UserManager.getInstance();
|
||||||
|
|
||||||
@ -94,6 +93,18 @@ public class CommandLineController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
if (CommandLineOptions.cmd_stats) {
|
||||||
cmd_stats();
|
cmd_stats();
|
||||||
System.exit(0);
|
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()) {
|
if (user.isLoggedIn()) {
|
||||||
System.out.println("You are logged in as " + Utils.anonymize(user.getUserString()));
|
System.out.println("You are logged in as " + Utils.anonymize(user.getUserString()));
|
||||||
|
Loading…
Reference in New Issue
Block a user