]> nmode's Git Repositories - signal-cli/commitdiff
Use the old config directory .config/textsecure as fallback
authorAsamK <asamk@gmx.de>
Sun, 27 Mar 2016 12:02:28 +0000 (14:02 +0200)
committerAsamK <asamk@gmx.de>
Sun, 27 Mar 2016 14:17:42 +0000 (16:17 +0200)
README.md
src/main/java/org/asamk/signal/Main.java

index f951669deeab03b4fe979ed93d93398a96fcda0b..e2a3145e2f48bb213892ab86f521403fe4bb14cd 100644 (file)
--- a/README.md
+++ b/README.md
@@ -78,6 +78,10 @@ The password and cryptographic keys are created when registering and stored in t
 
         $HOME/.config/signal/data/
 
+For legacy users, the old config directory is used as a fallback:
+
+        $HOME/.config/textsecure/data/
+
 ## Building
 
 This project uses [Gradle](http://gradle.org) for building and maintaining
index a4e50bb46ebea6ee95c30bf150b2b0f473505424..5d6e419ba9fc744885221604d7b1e4cd1dd26b98 100644 (file)
@@ -83,6 +83,12 @@ public class Main {
                 String settingsPath = ns.getString("config");
                 if (TextUtils.isEmpty(settingsPath)) {
                     settingsPath = System.getProperty("user.home") + "/.config/signal";
+                    if (!new File(settingsPath).exists()) {
+                        String legacySettingsPath = System.getProperty("user.home") + "/.config/textsecure";
+                        if (new File(legacySettingsPath).exists()) {
+                            settingsPath = legacySettingsPath;
+                        }
+                    }
                 }
 
                 m = new Manager(username, settingsPath);