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=5b5162bc0333b789d5518f2e7303fd5ffecad83b;hpb=785c18104f2448242e56f33b0234dc5fa755f160;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 5b5162b..03cecee 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - GetStatusAjaxPage.java - Copyright © 2010 David Roden + * Sone - GetNotificationAjaxPage.java - Copyright © 2010 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 @@ -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);