From 7bf06aef5ecea8856aeebc5c9d3a67d11cb73b92 Mon Sep 17 00:00:00 2001 From: AsamK Date: Wed, 8 Jun 2022 17:26:37 +0200 Subject: [PATCH] Store self profile key in profile store after linking --- .../asamk/signal/manager/storage/SignalAccount.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java index f66d3e4a..6d636359 100644 --- a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java +++ b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java @@ -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; -- 2.50.1