X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDismissNotificationPage.java;h=9d7919586cddde6a2ce4b6ae2182056ae00a2bbe;hb=38cb6c5ec82298ee351d0eb15ddd8331db273af2;hp=bdbf00816afcfdcc55d1017ba7ea15bada9eac07;hpb=75771a85377be48674caeedca8253c9c3dbdf818;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/DismissNotificationPage.java b/src/main/java/net/pterodactylus/sone/web/DismissNotificationPage.java index bdbf008..9d79195 100644 --- a/src/main/java/net/pterodactylus/sone/web/DismissNotificationPage.java +++ b/src/main/java/net/pterodactylus/sone/web/DismissNotificationPage.java @@ -17,8 +17,10 @@ package net.pterodactylus.sone.web; +import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.notify.Notification; import net.pterodactylus.util.template.Template; +import net.pterodactylus.util.template.TemplateContext; /** * Page that lets the user dismiss a notification. @@ -47,14 +49,14 @@ public class DismissNotificationPage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected void processTemplate(Request request, Template template) throws RedirectException { - super.processTemplate(request, template); + protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException { + super.processTemplate(request, templateContext); String notificationId = request.getHttpRequest().getPartAsStringFailsafe("notification", 36); - Notification notification = webInterface.getCore().getNotifications().getNotification(notificationId); + Notification notification = webInterface.getNotifications().getNotification(notificationId); if ((notification != null) && notification.isDismissable()) { - webInterface.getCore().getNotifications().removeNotification(notification); + notification.dismiss(); } - String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64); + String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256); throw new RedirectException(returnPage); }