Allow late initialization of some PNI keys.

This commit is contained in:
Greyson Parrelli
2022-02-21 09:12:03 -05:00
parent 1f0c56546e
commit 472c8a441f
2 changed files with 34 additions and 22 deletions

View File

@@ -27,6 +27,7 @@ import org.thoughtcrime.securesms.jobmanager.JobManager;
import org.thoughtcrime.securesms.jobmanager.JobMigrator;
import org.thoughtcrime.securesms.jobmanager.impl.FactoryJobPredicate;
import org.thoughtcrime.securesms.jobmanager.impl.JsonDataSerializer;
import org.thoughtcrime.securesms.jobs.CreateSignedPreKeyJob;
import org.thoughtcrime.securesms.jobs.FastJobStorage;
import org.thoughtcrime.securesms.jobs.GroupCallUpdateSendJob;
import org.thoughtcrime.securesms.jobs.JobManagerFactories;
@@ -289,6 +290,11 @@ public class ApplicationDependencyProvider implements ApplicationDependencies.Pr
throw new IllegalStateException("No PNI set!");
}
if (!SignalStore.account().hasPniIdentityKey()) {
SignalStore.account().generatePniIdentityKey();
CreateSignedPreKeyJob.enqueueIfNeeded();
}
SignalBaseIdentityKeyStore baseIdentityStore = new SignalBaseIdentityKeyStore(context);
SignalServiceAccountDataStoreImpl aciStore = new SignalServiceAccountDataStoreImpl(context,