X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetReplyAjaxPage.kt;h=c6cfc2f0e37044dd221e874c82e17828cfd96d3f;hp=a9709e8e719d6c6ada699fdff230ffeeca533b16;hb=889119651988ace06a94568a661f29b87f1af99e;hpb=877644f873c449f07d59ed984d912538db7e0fa6 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.kt index a9709e8..c6cfc2f 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.kt @@ -3,7 +3,6 @@ package net.pterodactylus.sone.web.ajax import net.pterodactylus.sone.data.PostReply import net.pterodactylus.sone.data.Sone import net.pterodactylus.sone.utils.jsonObject -import net.pterodactylus.sone.utils.let import net.pterodactylus.sone.utils.parameters import net.pterodactylus.sone.utils.render import net.pterodactylus.sone.web.WebInterface @@ -15,11 +14,11 @@ import net.pterodactylus.util.template.Template */ class GetReplyAjaxPage(webInterface: WebInterface, private val template: Template) : LoggedInJsonPage("getReply.ajax", webInterface) { - override fun needsFormPassword() = false + override val needsFormPassword = false override fun createJsonObject(currentSone: Sone, request: FreenetRequest) = request.parameters["reply"] - .let(webInterface.core::getPostReply) + ?.let(core::getPostReply) ?.let { it.toJson(currentSone, request) } ?.let { replyJson -> createSuccessJsonObject().apply { @@ -37,7 +36,7 @@ class GetReplyAjaxPage(webInterface: WebInterface, private val template: Templat private fun PostReply.render(currentSone: Sone, request: FreenetRequest) = webInterface.templateContextFactory.createTemplateContext().apply { - set("core", webInterface.core) + set("core", core) set("request", request) set("reply", this@render) set("currentSone", currentSone)