X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FDeleteReplyAjaxPage.kt;h=a7ef1a1f42aac19120bae395bc9695824d403276;hp=2108daff9295fb8c750c308d5b02543ca2bb1b59;hb=d14188d87056cfd63490ef9f16f4aae0c1864864;hpb=ffd92ca2374c0b2218e583d02e0bdd24b8c110ae diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.kt index 2108daf..a7ef1a1 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.kt @@ -1,20 +1,20 @@ package net.pterodactylus.sone.web.ajax -import net.pterodactylus.sone.data.Sone -import net.pterodactylus.sone.utils.ifTrue -import net.pterodactylus.sone.utils.let -import net.pterodactylus.sone.utils.parameters -import net.pterodactylus.sone.web.WebInterface -import net.pterodactylus.sone.web.page.FreenetRequest +import net.pterodactylus.sone.data.* +import net.pterodactylus.sone.utils.* +import net.pterodactylus.sone.web.* +import net.pterodactylus.sone.web.page.* +import javax.inject.* /** * This AJAX page deletes a reply. */ -class DeleteReplyAjaxPage(webInterface: WebInterface) : LoggedInJsonPage("deleteReply.ajax", webInterface) { +class DeleteReplyAjaxPage @Inject constructor(webInterface: WebInterface) : + LoggedInJsonPage("deleteReply.ajax", webInterface) { override fun createJsonObject(currentSone: Sone, request: FreenetRequest) = request.parameters["reply"] - .let(core::getPostReply) + ?.let(core::getPostReply) ?.let { reply -> reply.sone.isLocal.ifTrue { createSuccessJsonObject().also {