Persist compatibility mode in configuration
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 24 Jul 2015 20:05:30 +0000 (22:05 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 24 Jul 2015 20:05:30 +0000 (22:05 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java

index 68cf4b2..b4a94e4 100644 (file)
@@ -1621,6 +1621,9 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                                configuration.getStringValue("SoneFollowingTimes/" + soneCounter + "/Sone").setValue(null);
                        }
 
+                       /* save compatibility modes. */
+                       configuration.getBooleanValue("CompatibilityModes/OldElementIds").setValue(compatibilityModes.contains(CompatibilityMode.oldElementIds));
+
                        /* save known posts. */
                        database.save();
 
@@ -1669,6 +1672,11 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                        }
                        ++soneCounter;
                }
+
+               /* load compatibility modes. */
+               if (configuration.getBooleanValue("CompatibilityModes/OldElementIds").getValue(false)) {
+                       setCompatibilityMode(CompatibilityMode.oldElementIds);
+               }
        }
 
        /**