]> nmode's Git Repositories - signal-cli/commitdiff
Only update account attributes if already registered
authorAsamK <asamk@gmx.de>
Tue, 1 Dec 2020 18:06:41 +0000 (19:06 +0100)
committerAsamK <asamk@gmx.de>
Tue, 1 Dec 2020 18:06:41 +0000 (19:06 +0100)
src/main/java/org/asamk/signal/manager/Manager.java

index 56376f0e8bdab689346cfc0895cb329fd7cbb4a1..3eab843e3391bfe276d97b92c536f8d87e5469bd 100644 (file)
@@ -250,13 +250,15 @@ public class Manager implements Closeable {
         Manager m = new Manager(account, pathConfig, serviceConfiguration, userAgent);
 
         m.migrateLegacyConfigs();
-        m.updateAccountAttributes();
+        if (m.isRegistered()) {
+            m.updateAccountAttributes();
+        }
 
         return m;
     }
 
     private void migrateLegacyConfigs() {
-        if (account.getProfileKey() == null) {
+        if (account.getProfileKey() == null && isRegistered()) {
             // Old config file, creating new profile key
             account.setProfileKey(KeyUtils.createProfileKey());
             account.save();