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