X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetNotificationAjaxPage.java;h=03ceceebe356f3e9c02322474f8523c7bc7c5382;hb=b90831223c33e2284b409f9745151363e61f16aa;hp=650a9ae442eeba787c748e0d82336dfbd04dad2d;hpb=d0ae5f106a59d7ac808e03287af2e5a33e50ba8b;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..03cecee 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,10 +78,9 @@ 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); } else if ("new-reply-notification".equals(notificationId)) { @@ -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);