Clean up SoneTemplatePage’s constructors
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / MarkAsKnownPage.kt
index bc96af5..da609a6 100644 (file)
@@ -13,14 +13,14 @@ import net.pterodactylus.util.template.TemplateContext
  * [Replie][net.pterodactylus.sone.data.Reply]s as known.
  */
 class MarkAsKnownPage(template: Template, webInterface: WebInterface):
-               SoneTemplatePage("markAsKnown.html", template, "Page.MarkAsKnown.Title", webInterface, false) {
+               SoneTemplatePage("markAsKnown.html", webInterface, template, "Page.MarkAsKnown.Title") {
 
        override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) {
                val ids = freenetRequest.parameters["id", 65536]!!.split(" ")
                when (freenetRequest.parameters["type", 5]) {
                        "sone" -> ids.mapNotNull(webInterface.core::getSone).forEach(webInterface.core::markSoneKnown)
-                       "post" -> ids.mapPresent(webInterface.core::getPost).forEach(webInterface.core::markPostKnown)
-                       "reply" -> ids.mapPresent(webInterface.core::getPostReply).forEach(webInterface.core::markReplyKnown)
+                       "post" -> ids.mapNotNull(webInterface.core::getPost).forEach(webInterface.core::markPostKnown)
+                       "reply" -> ids.mapNotNull(webInterface.core::getPostReply).forEach(webInterface.core::markReplyKnown)
                        else -> throw RedirectException("invalid.html")
                }
                throw RedirectException(freenetRequest.parameters["returnPage", 256]!!)