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=223a79f257747e82936eb57a41824d91d1eef635;hp=1f23e4a3dd3b73be008183ef61eb714aabc1935d;hb=632116a9843914f931e6bc3e2d56a0b1961a4db9;hpb=89e431b7cda6e2091bad97c9bfa2aa1b3f4409f0 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 1f23e4a..223a79f 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - GetStatusAjaxPage.java - Copyright © 2010 David Roden + * Sone - GetStatusAjaxPage.java - Copyright © 2010–2012 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,8 +32,8 @@ import net.pterodactylus.sone.notify.ListNotificationFilters; import net.pterodactylus.sone.template.SoneAccessor; import net.pterodactylus.sone.web.WebInterface; import net.pterodactylus.sone.web.page.FreenetRequest; -import net.pterodactylus.util.filter.Filter; -import net.pterodactylus.util.filter.Filters; +import net.pterodactylus.util.collection.filter.Filter; +import net.pterodactylus.util.collection.filter.Filters; import net.pterodactylus.util.json.JsonArray; import net.pterodactylus.util.json.JsonObject; import net.pterodactylus.util.notify.Notification; @@ -91,6 +91,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(); @@ -177,7 +178,7 @@ public class GetStatusAjaxPage extends JsonPage { jsonSone.put("id", sone.getId()); jsonSone.put("name", SoneAccessor.getNiceName(sone)); jsonSone.put("local", sone.getInsertUri() != null); - jsonSone.put("status", webInterface.getCore().getSoneStatus(sone).name()); + jsonSone.put("status", sone.getStatus().name()); jsonSone.put("modified", webInterface.getCore().isModifiedSone(sone)); jsonSone.put("locked", webInterface.getCore().isLocked(sone)); jsonSone.put("lastUpdatedUnknown", sone.getTime() == 0);