X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetNotificationAjaxPage.java;h=34770c6f1683e3ef950b1c102f9fe7a83442171d;hb=012439f891860c345b6bcab68e663bdd93c9aeb5;hp=650a9ae442eeba787c748e0d82336dfbd04dad2d;hpb=aa94dcb712392b69cb431d1637e4948688d15791;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java index 650a9ae..34770c6 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java @@ -19,7 +19,6 @@ package net.pterodactylus.sone.web.ajax; import java.io.IOException; import java.io.StringWriter; -import java.util.ArrayList; import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.Reply; @@ -79,12 +78,11 @@ public class GetNotificationAjaxPage extends JsonPage { protected JsonObject createJsonObject(Request request) { String[] notificationIds = request.getHttpRequest().getParam("notifications").split(","); JsonObject jsonNotifications = new JsonObject(); - Sone currentSone = webInterface.getCurrentSone(request.getToadletContext(), false); + Sone currentSone = getCurrentSone(request.getToadletContext(), false); for (String notificationId : notificationIds) { Notification notification = webInterface.getNotifications().getNotification(notificationId); - ListNotificationFilters.filterNotifications(new ArrayList(), currentSone); if ("new-post-notification".equals(notificationId)) { - notification = ListNotificationFilters.filterNewPostNotification((ListNotification) notification, currentSone); + notification = ListNotificationFilters.filterNewPostNotification((ListNotification) notification, currentSone, false); } else if ("new-reply-notification".equals(notificationId)) { notification = ListNotificationFilters.filterNewReplyNotification((ListNotification) notification, currentSone); } @@ -117,6 +115,7 @@ public class GetNotificationAjaxPage extends JsonPage { try { if (notification instanceof TemplateNotification) { TemplateContext templateContext = webInterface.getTemplateContextFactory().createTemplateContext().mergeContext(((TemplateNotification) notification).getTemplateContext()); + templateContext.set("core", webInterface.getCore()); templateContext.set("currentSone", webInterface.getCurrentSone(request.getToadletContext(), false)); templateContext.set("localSones", webInterface.getCore().getLocalSones()); templateContext.set("request", request);