X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetStatusAjaxPage.java;h=dcf443a89d825191552a6bdf8cbec08aac297057;hb=535ff37f006c1dd058590667e3b895ebc66af04a;hp=bb59a8da87e57eb4358adae98b6a333a1f3072ab;hpb=464fee6c08c68ad2b5f76ad5d9d32fcd545713c6;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java index bb59a8d..dcf443a 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -29,6 +29,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import net.pterodactylus.sone.data.LocalSone; import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.data.Sone; @@ -73,7 +74,7 @@ public class GetStatusAjaxPage extends JsonPage { */ @Override protected JsonReturnObject createJsonObject(FreenetRequest request) { - final Optional currentSone = getCurrentSone(request.getToadletContext(), false); + final Optional currentSone = getCurrentSone(request.getToadletContext(), false); /* load Sones. always return the status of the current Sone. */ Set sones = new HashSet(currentSone.asSet()); String loadSoneIds = request.getHttpRequest().getParam("soneIds"); @@ -172,8 +173,8 @@ public class GetStatusAjaxPage extends JsonPage { jsonSone.put("name", SoneAccessor.getNiceName(sone)); jsonSone.put("local", sone.getInsertUri() != null); jsonSone.put("status", sone.getStatus().name()); - jsonSone.put("modified", webInterface.getCore().isModifiedSone(sone)); - jsonSone.put("locked", webInterface.getCore().isLocked(sone)); + jsonSone.put("modified", sone.isLocal() ? webInterface.getCore().isModifiedSone((LocalSone) sone) : false); + jsonSone.put("locked", sone.isLocal() ? webInterface.getCore().isLocked((LocalSone) sone) : false); jsonSone.put("lastUpdatedUnknown", sone.getTime() == 0); synchronized (dateFormat) { jsonSone.put("lastUpdated", dateFormat.format(new Date(sone.getTime()))); @@ -191,7 +192,7 @@ public class GetStatusAjaxPage extends JsonPage { * The current Sone (may be {@code null}) * @return The current options */ - private static JsonNode createJsonOptions(Optional currentSone) { + private static JsonNode createJsonOptions(Optional currentSone) { ObjectNode options = new ObjectNode(instance); if (currentSone.isPresent()) { options.put("ShowNotification/NewSones", currentSone.get().getOptions().isShowNewSoneNotifications());