X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=90fc3142ac0b86ef9e3567cf0d3b97d9ef0329e9;hb=9359e98d853739ec57c24ef0ff2d69c8ce29847d;hp=8e00e23668f76f11bd0c84e84b55c746a14b9413;hpb=6b65a32a69b0e3721c58b4501a6b58fa4989f162;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 8e00e23..90fc314 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -27,6 +27,7 @@ import static java.util.logging.Logger.getLogger; import java.util.ArrayList; import java.util.Collection; +import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -154,6 +155,8 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, /** The trust updater. */ private final WebOfTrustUpdater webOfTrustUpdater; + private final Set compatibilityModes = EnumSet.noneOf(CompatibilityMode.class); + /** The times Sones were followed. */ private final Map soneFollowingTimes = new HashMap(); @@ -273,6 +276,18 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, return updateChecker; } + public boolean isCompatibilityMode(CompatibilityMode compatibilityMode) { + return compatibilityModes.contains(compatibilityMode); + } + + public void setCompatibilityMode(CompatibilityMode compatibilityMode) { + compatibilityModes.add(compatibilityMode); + } + + public void clearCompatibilityMod(CompatibilityMode compatibilityMode) { + compatibilityModes.remove(compatibilityMode); + } + /** * Returns the Sone rescuer for the given local Sone. * @@ -1476,7 +1491,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, int postCounter = 0; for (Post post : sone.getPosts()) { String postPrefix = sonePrefix + "/Posts/" + postCounter++; - configuration.getStringValue(postPrefix + "/ID").setValue(post.getId()); + configuration.getStringValue(postPrefix + "/ID").setValue(post.getInternalId()); configuration.getStringValue(postPrefix + "/Recipient").setValue(post.getRecipientId().orNull()); configuration.getLongValue(postPrefix + "/Time").setValue(post.getTime()); configuration.getStringValue(postPrefix + "/Text").setValue(post.getText()); @@ -1530,7 +1545,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, continue; } String imagePrefix = sonePrefix + "/Images/" + imageCounter++; - configuration.getStringValue(imagePrefix + "/ID").setValue(image.getId()); + configuration.getStringValue(imagePrefix + "/ID").setValue(image.getInternalId()); configuration.getStringValue(imagePrefix + "/Album").setValue(album.getInternalId()); configuration.getStringValue(imagePrefix + "/Key").setValue(image.getKey()); configuration.getStringValue(imagePrefix + "/Title").setValue(image.getTitle());