X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FBookmarkPage.kt;h=5bc21d1d05c99a1187f3c23cc0b7ee71ccaf5d90;hp=92279718b193ca5911b6831cab5f391cbea87cda;hb=9acbc5bdec4ccb752e0856a501568b0bb6161579;hpb=7e0b2b0e1af1aa27110849f41c742c9b61e3f446 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/BookmarkPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/BookmarkPage.kt index 9227971..5bc21d1 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/BookmarkPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/BookmarkPage.kt @@ -1,21 +1,18 @@ package net.pterodactylus.sone.web +import net.pterodactylus.sone.utils.isPOST import net.pterodactylus.sone.web.page.FreenetRequest import net.pterodactylus.util.template.Template import net.pterodactylus.util.template.TemplateContext -import net.pterodactylus.util.web.Method.POST -import javax.inject.Inject -import javax.inject.Singleton /** * Page that lets the user bookmark a post. */ -@Singleton -class BookmarkPage @Inject constructor(template: Template, webInterface: WebInterface) +class BookmarkPage(template: Template, webInterface: WebInterface) : SoneTemplatePage("bookmark.html", template, "Page.Bookmark.Title", webInterface) { override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) { - if (freenetRequest.method == POST) { + if (freenetRequest.isPOST) { val returnPage = freenetRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256) val postId = freenetRequest.httpRequest.getPartAsStringFailsafe("post", 36) webInterface.core.getPost(postId).orNull()?.let {