X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FDismissNotificationPage.kt;h=9f8eeb42594a897802559af36c58a0227ed96ada;hb=c2802b8888fadadf7bc322739ec466762ac2cc4a;hp=6e8a3d2d6192783d36208dd13c70c6546a0692ec;hpb=de7568a82eb4150bf6d2b0553841b7b69f84c968;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DismissNotificationPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DismissNotificationPage.kt index 6e8a3d2..9f8eeb4 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DismissNotificationPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DismissNotificationPage.kt @@ -1,6 +1,5 @@ package net.pterodactylus.sone.web.pages -import net.pterodactylus.sone.web.pages.SoneTemplatePage import net.pterodactylus.sone.web.WebInterface import net.pterodactylus.sone.web.page.FreenetRequest import net.pterodactylus.util.template.Template @@ -10,11 +9,11 @@ import net.pterodactylus.util.template.TemplateContext * Page that lets the user dismiss a notification. */ class DismissNotificationPage(template: Template, webInterface: WebInterface): - SoneTemplatePage("dismissNotification.html", template, "Page.DismissNotification.Title", webInterface) { + SoneTemplatePage("dismissNotification.html", webInterface, template, "Page.DismissNotification.Title") { - override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) { - val returnPage = request.httpRequest.getPartAsStringFailsafe("returnPage", 256) - val notificationId = request.httpRequest.getPartAsStringFailsafe("notification", 36) + override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) { + val returnPage = freenetRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256) + val notificationId = freenetRequest.httpRequest.getPartAsStringFailsafe("notification", 36) webInterface.getNotification(notificationId).orNull()?.takeIf { it.isDismissable }?.dismiss() throw RedirectException(returnPage) }