♻️ Use SoneRequest instead of FreenetRequest
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / BookmarkPage.kt
index bcff177..81cd332 100644 (file)
@@ -2,7 +2,7 @@ package net.pterodactylus.sone.web.pages
 
 import net.pterodactylus.sone.utils.isPOST
 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
@@ -13,12 +13,12 @@ import javax.inject.Inject
 class BookmarkPage @Inject constructor(template: Template, webInterface: WebInterface)
        : SoneTemplatePage("bookmark.html", webInterface, template, "Page.Bookmark.Title") {
 
-       override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) {
-               if (freenetRequest.isPOST) {
-                       val returnPage = freenetRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)
-                       val postId = freenetRequest.httpRequest.getPartAsStringFailsafe("post", 36)
-                       webInterface.core.getPost(postId)?.let {
-                               webInterface.core.bookmarkPost(it)
+       override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) {
+               if (soneRequest.isPOST) {
+                       val returnPage = soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)
+                       val postId = soneRequest.httpRequest.getPartAsStringFailsafe("post", 36)
+                       soneRequest.core.getPost(postId)?.let {
+                               soneRequest.core.bookmarkPost(it)
                        }
                        throw RedirectException(returnPage)
                }