X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSoneTemplatePage.java;h=b0d31d24f2482dd8ac0f3618d5dc7475b2a88cae;hp=095db9e75e08b49ff7cb30a755893f60e9d1bcca;hb=c9e306ac8e3ada846e87a0cc256a20fc148f381c;hpb=0df5e91852f737d760c5a9f54c5667309fbadcc2 diff --git a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java index 095db9e..b0d31d2 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -21,6 +21,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -31,6 +32,8 @@ import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.sone.web.page.FreenetTemplatePage; import net.pterodactylus.util.collection.ListBuilder; import net.pterodactylus.util.collection.MapBuilder; +import net.pterodactylus.util.notify.Notification; +import net.pterodactylus.util.object.HashCode; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; import freenet.clients.http.SessionManager.Session; @@ -259,7 +262,10 @@ public class SoneTemplatePage extends FreenetTemplatePage { templateContext.set("latestEdition", webInterface.getCore().getUpdateChecker().getLatestEdition()); templateContext.set("latestVersion", webInterface.getCore().getUpdateChecker().getLatestVersion()); templateContext.set("latestVersionTime", webInterface.getCore().getUpdateChecker().getLatestVersionDate()); - templateContext.set("notifications", ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone)); + List notifications = ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone); + Collections.sort(notifications, Notification.CREATED_TIME_SORTER); + templateContext.set("notifications", notifications); + templateContext.set("notificationHash", HashCode.hashCode(notifications)); } /**