X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FUntrustAjaxPage.kt;fp=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FUntrustAjaxPage.kt;h=0000000000000000000000000000000000000000;hp=e4b5edb2c618c147e16ae7774f7114d2b190ee62;hb=28be0e47c683650202cc74795d002acd10616642;hpb=5d7419dfefdc2c98ac478068fcc727359ec8bfe4 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/UntrustAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/UntrustAjaxPage.kt deleted file mode 100644 index e4b5edb..0000000 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/UntrustAjaxPage.kt +++ /dev/null @@ -1,22 +0,0 @@ -package net.pterodactylus.sone.web.ajax - -import net.pterodactylus.sone.data.Sone -import net.pterodactylus.sone.utils.parameters -import net.pterodactylus.sone.web.WebInterface -import net.pterodactylus.sone.web.page.* -import javax.inject.Inject - -/** - * AJAX page that lets the user [untrust][net.pterodactylus.sone.core.Core.untrustSone] a [Sone]. - */ -@ToadletPath("untrustSone.ajax") -class UntrustAjaxPage @Inject constructor(webInterface: WebInterface) : LoggedInJsonPage(webInterface) { - - override fun createJsonObject(currentSone: Sone, request: FreenetRequest) = - request.parameters["sone"] - ?.let(core::getSone) - ?.also { core.untrustSone(currentSone, it) } - ?.let { createSuccessJsonObject() } - ?: createErrorJsonObject("invalid-sone-id") - -}