import net.pterodactylus.sone.web.page.FreenetRequest
import net.pterodactylus.util.template.Template
import net.pterodactylus.util.template.TemplateContext
+import javax.inject.Inject
/**
* Page that lets the user unbookmark a post.
*/
-class UnbookmarkPage(template: Template, webInterface: WebInterface):
- SoneTemplatePage("unbookmark.html", template, "Page.Unbookmark.Title", webInterface, false) {
+class UnbookmarkPage @Inject constructor(template: Template, webInterface: WebInterface):
+ SoneTemplatePage("unbookmark.html", webInterface, template, "Page.Unbookmark.Title") {
override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) {
when {
}
freenetRequest.isPOST -> {
freenetRequest.parameters["post", 36]
- .let(webInterface.core::getPost)
- .also(webInterface.core::unbookmarkPost)
+ ?.let(webInterface.core::getPost)
+ ?.also(webInterface.core::unbookmarkPost)
throw RedirectException(freenetRequest.parameters["returnPage", 256])
}
}