X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetNotificationsAjaxPage.java;h=4e9a879dd748ddb712f1999b0b758667bed98832;hp=d0020ca78ef94313c487a2355f62867c65cc673e;hb=a47643aed43d118ca68044f95451bb5374cdb332;hpb=322bfaef40f5471467e55b979959e8f561b54129 diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationsAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationsAjaxPage.java index d0020ca..4e9a879 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationsAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationsAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - GetNotificationsAjaxPage.java - Copyright © 2011 David Roden + * Sone - GetNotificationsAjaxPage.java - Copyright © 2011–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 @@ -20,6 +20,7 @@ package net.pterodactylus.sone.web.ajax; import java.io.IOException; import java.io.StringWriter; import java.util.Collection; +import java.util.Collections; import java.util.List; import net.pterodactylus.sone.data.Sone; @@ -79,6 +80,7 @@ public class GetNotificationsAjaxPage extends JsonPage { Sone currentSone = getCurrentSone(request.getToadletContext(), false); Collection notifications = webInterface.getNotifications().getNotifications(); List filteredNotifications = ListNotificationFilters.filterNotifications(notifications, currentSone); + Collections.sort(filteredNotifications, Notification.CREATED_TIME_SORTER); int notificationHash = HashCode.hashCode(filteredNotifications); JsonArray jsonNotifications = new JsonArray(); for (Notification notification : filteredNotifications) {