X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetStatusAjaxPage.java;h=0466098ea9303306ed83f8cf70d76502e522bfc3;hp=28fee14135947f78952ce118d4f3a856cb28ab81;hb=598d33ea54fbac701192b58f21ee2b4459ca4fab;hpb=480691a26222e035e53bda56029524e160fdf898 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 28fee14..0466098 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -66,19 +66,14 @@ public class GetStatusAjaxPage extends JsonPage { @Override protected JsonObject createJsonObject(FreenetRequest request) { final Sone currentSone = getCurrentSone(request.getToadletContext(), false); - /* load Sones. */ - boolean loadAllSones = Boolean.parseBoolean(request.getHttpRequest().getParam("loadAllSones", "false")); + /* load Sones. always return the status of the current Sone. */ Set sones = new HashSet(Collections.singleton(getCurrentSone(request.getToadletContext(), false))); - if (loadAllSones) { - sones.addAll(webInterface.getCore().getSones()); - } else { - String loadSoneIds = request.getHttpRequest().getParam("soneIds"); - if (loadSoneIds.length() > 0) { - String[] soneIds = loadSoneIds.split(","); - for (String soneId : soneIds) { - /* just add it, we skip null further down. */ - sones.add(webInterface.getCore().getSone(soneId, false)); - } + String loadSoneIds = request.getHttpRequest().getParam("soneIds"); + if (loadSoneIds.length() > 0) { + String[] soneIds = loadSoneIds.split(","); + for (String soneId : soneIds) { + /* just add it, we skip null further down. */ + sones.add(webInterface.getCore().getSone(soneId, false)); } } JsonArray jsonSones = new JsonArray(); @@ -91,6 +86,7 @@ public class GetStatusAjaxPage extends JsonPage { } /* load notifications. */ List notifications = ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone); + Collections.sort(notifications, Notification.CREATED_TIME_SORTER); int notificationHash = HashCode.hashCode(notifications); /* load new posts. */ Set newPosts = webInterface.getNewPosts();