X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetNotificationAjaxPage.java;h=8bfe47273a76a497ebbf484d10736506274b6042;hb=1bc78b582ac59f2438002997f5780db4dcee0a2a;hp=0472349707b44c55247bc2cbb8225a761b5fd3ae;hpb=6f550611d5a0b9beece55ebdfd18a5c8b3722356;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 0472349..8bfe472 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetNotificationAjaxPage.java @@ -82,9 +82,11 @@ public class GetNotificationAjaxPage extends JsonPage { for (String notificationId : notificationIds) { Notification notification = webInterface.getNotifications().getNotification(notificationId); if ("new-post-notification".equals(notificationId)) { - notification = ListNotificationFilters.filterNewPostNotification((ListNotification) notification, currentSone); - } else if ("new-replies-notification".equals(notificationId)) { + notification = ListNotificationFilters.filterNewPostNotification((ListNotification) notification, currentSone, false); + } else if ("new-reply-notification".equals(notificationId)) { notification = ListNotificationFilters.filterNewReplyNotification((ListNotification) notification, currentSone); + } else if ("mention-notification".equals(notificationId)) { + notification = ListNotificationFilters.filterNewPostNotification((ListNotification) notification, currentSone, false); } if (notification == null) { // TODO - show error @@ -115,6 +117,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);