]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java
Implement username links
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / SignalAccountFiles.java
index da8a3f3a837bf5ff32696d9da1e833e63c07f7c5..03c44013eedd2cc22c4637beab9761729f910c46 100644 (file)
@@ -14,7 +14,6 @@ import org.asamk.signal.manager.internal.RegistrationManagerImpl;
 import org.asamk.signal.manager.storage.SignalAccount;
 import org.asamk.signal.manager.storage.accounts.AccountsStore;
 import org.asamk.signal.manager.util.KeyUtils;
-import org.signal.libsignal.protocol.util.KeyHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException;
@@ -160,8 +159,6 @@ public class SignalAccountFiles {
             final var newAccountPath = accountPath == null ? accountsStore.addAccount(number, null) : accountPath;
             var aciIdentityKey = KeyUtils.generateIdentityKeyPair();
             var pniIdentityKey = KeyUtils.generateIdentityKeyPair();
-            var registrationId = KeyHelper.generateRegistrationId(false);
-            var pniRegistrationId = KeyHelper.generateRegistrationId(false);
 
             var profileKey = KeyUtils.createProfileKey();
             var account = SignalAccount.create(pathConfig.dataPath(),
@@ -170,10 +167,9 @@ public class SignalAccountFiles {
                     serviceEnvironment,
                     aciIdentityKey,
                     pniIdentityKey,
-                    registrationId,
-                    pniRegistrationId,
                     profileKey,
                     settings);
+            account.initDatabase();
 
             return new RegistrationManagerImpl(account,
                     pathConfig,
@@ -188,6 +184,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,