]> nmode's Git Repositories - signal-cli/commitdiff
Store self profile key in profile store after linking
authorAsamK <asamk@gmx.de>
Wed, 8 Jun 2022 15:26:37 +0000 (17:26 +0200)
committerAsamK <asamk@gmx.de>
Wed, 8 Jun 2022 15:51:16 +0000 (17:51 +0200)
lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java

index f66d3e4a9db01a7f59f525aab37cee109a5c8059..6d63635933362d16cc68ba989a4b9fdb56b8eb93 100644 (file)
@@ -313,6 +313,11 @@ public class SignalAccount implements Closeable {
         final var pair = openFileChannel(fileName, true);
         var signalAccount = new SignalAccount(pair.first(), pair.second());
 
+        signalAccount.dataPath = dataPath;
+        signalAccount.accountPath = accountPath;
+        signalAccount.serviceEnvironment = serviceEnvironment;
+        signalAccount.localRegistrationId = registrationId;
+        signalAccount.trustNewIdentity = trustNewIdentity;
         signalAccount.setProvisioningData(number,
                 aci,
                 pni,
@@ -323,11 +328,6 @@ public class SignalAccount implements Closeable {
                 pniIdentityKey,
                 profileKey);
 
-        signalAccount.dataPath = dataPath;
-        signalAccount.accountPath = accountPath;
-        signalAccount.serviceEnvironment = serviceEnvironment;
-        signalAccount.localRegistrationId = registrationId;
-        signalAccount.trustNewIdentity = trustNewIdentity;
         signalAccount.groupStore = new GroupStore(getGroupCachePath(dataPath, accountPath),
                 signalAccount.getRecipientResolver(),
                 signalAccount::saveGroupStore);
@@ -360,6 +360,7 @@ public class SignalAccount implements Closeable {
         this.pni = pni;
         this.password = password;
         this.profileKey = profileKey;
+        getProfileStore().storeSelfProfileKey(getSelfRecipientId(), getProfileKey());
         this.encryptedDeviceName = encryptedDeviceName;
         this.deviceId = deviceId;
         this.aciIdentityKeyPair = aciIdentity;