♻️ Use SoneRequest instead of FreenetRequest
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / DismissNotificationPage.kt
index 3cb3c43..ae0cfe0 100644 (file)
@@ -1,7 +1,7 @@
 package net.pterodactylus.sone.web.pages
 
 import net.pterodactylus.sone.web.WebInterface
-import net.pterodactylus.sone.web.page.FreenetRequest
+import net.pterodactylus.sone.web.page.*
 import net.pterodactylus.util.template.Template
 import net.pterodactylus.util.template.TemplateContext
 import javax.inject.Inject
@@ -12,10 +12,10 @@ import javax.inject.Inject
 class DismissNotificationPage @Inject constructor(template: Template, webInterface: WebInterface):
                SoneTemplatePage("dismissNotification.html", webInterface, template, "Page.DismissNotification.Title") {
 
-       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()
+       override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) {
+               val returnPage = soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)
+               val notificationId = soneRequest.httpRequest.getPartAsStringFailsafe("notification", 36)
+               soneRequest.webInterface.getNotification(notificationId).orNull()?.takeIf { it.isDismissable }?.dismiss()
                throw RedirectException(returnPage)
        }