Store self profile key in profile store after linking

This commit is contained in:
AsamK 2022-06-08 17:26:37 +02:00
parent 0e65e67077
commit 7bf06aef5e

View file

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