]> nmode's Git Repositories - signal-cli/commitdiff
Ensure profile key is stored in profileKeyStore
authorAsamK <asamk@gmx.de>
Fri, 3 Nov 2023 19:20:14 +0000 (20:20 +0100)
committerAsamK <asamk@gmx.de>
Fri, 3 Nov 2023 19:31:35 +0000 (20:31 +0100)
Fixes #1362

graalvm-config-dir/resource-config.json
lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java

index b79033ea6e81d8c258e05051f703d0ecbf4d4c3f..6902124a84e2e3dc393fe66f9eb666bf62830a70 100644 (file)
     "pattern":"\\Qkotlin/coroutines/coroutines.kotlin_builtins\\E"
   }, {
     "pattern":"\\Qkotlin/internal/internal.kotlin_builtins\\E"
+  }, {
+    "pattern":"\\Qkotlin/jvm/jvm.kotlin_builtins\\E"
   }, {
     "pattern":"\\Qkotlin/kotlin.kotlin_builtins\\E"
   }, {
index 1b501331d6428df3c4dfbbda1eec4ed72b8a6a6a..077ff732f20757fc71aab746f6a39f415b146424 100644 (file)
@@ -654,7 +654,7 @@ public class SignalAccount implements Closeable {
             // Old config file, creating new profile key
             setProfileKey(KeyUtils.createProfileKey());
         }
-        getProfileStore().storeProfileKey(getSelfRecipientId(), getProfileKey());
+        getProfileStore().storeSelfProfileKey(getSelfRecipientId(), getProfileKey());
 
         if (previousStorageVersion < 5) {
             final var legacyRecipientsStoreFile = new File(userPath, "recipients-store");
@@ -1185,10 +1185,12 @@ public class SignalAccount implements Closeable {
     }
 
     public RecipientStore getRecipientStore() {
-        return getOrCreate(() -> recipientStore,
-                () -> recipientStore = new RecipientStore(this::mergeRecipients,
-                        this::getSelfRecipientAddress,
-                        getAccountDatabase()));
+        return getOrCreate(() -> recipientStore, () -> {
+            recipientStore = new RecipientStore(this::mergeRecipients,
+                    this::getSelfRecipientAddress,
+                    getAccountDatabase());
+            getProfileStore().storeSelfProfileKey(getSelfRecipientId(), getProfileKey());
+        });
     }
 
     public ProfileStore getProfileStore() {