]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java
Fix NPR when loading an inactive group
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / SignalAccountFiles.java
index ef1606211fb041b8a33aeb4e237effa8bfac5a6a..4072a9df8fecd7f6461e39357278ae4c5bcf731e 100644 (file)
@@ -85,7 +85,8 @@ public class SignalAccountFiles {
     }
 
     private Manager initManager(
-            String number, String accountPath
+            String number,
+            String accountPath
     ) throws IOException, NotRegisteredException, AccountCheckException {
         if (accountPath == null) {
             throw new NotRegisteredException();
@@ -152,7 +153,8 @@ public class SignalAccountFiles {
     }
 
     public RegistrationManager initRegistrationManager(
-            String number, Consumer<Manager> newManagerListener
+            String number,
+            Consumer<Manager> newManagerListener
     ) throws IOException {
         final var accountPath = accountsStore.getPathByNumber(number);
         if (accountPath == null || !SignalAccount.accountFileExists(pathConfig.dataPath(), accountPath)) {
@@ -169,6 +171,7 @@ public class SignalAccountFiles {
                     pniIdentityKey,
                     profileKey,
                     settings);
+            account.initDatabase();
 
             return new RegistrationManagerImpl(account,
                     pathConfig,
@@ -183,6 +186,7 @@ public class SignalAccountFiles {
             account.close();
             throw new IOException("Number in account file doesn't match expected number: " + account.getNumber());
         }
+        account.initDatabase();
 
         return new RegistrationManagerImpl(account,
                 pathConfig,