X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FDistrustAjaxPage.kt;h=4eadfde45e2fca59b05a08c2972cdeaa3ecc5adb;hp=1c3506b9f078ce6c30ab108338372dc22080caf2;hb=8e313509a42a8c638fcac018dd73dd975bf9cb68;hpb=9e697ac643d11a2b7644a948732674eea195718a diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/DistrustAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/DistrustAjaxPage.kt index 1c3506b..4eadfde 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/DistrustAjaxPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/DistrustAjaxPage.kt @@ -16,12 +16,12 @@ class DistrustAjaxPage(webInterface: WebInterface) : LoggedInJsonPage("distrustS override fun createJsonObject(currentSone: Sone, request: FreenetRequest) = request.parameters["sone"] - .let(webInterface.core::getSone) + ?.let(core::getSone) ?.let { sone -> createSuccessJsonObject() - .put("trustValue", webInterface.core.preferences.negativeTrust) + .put("trustValue", core.preferences.negativeTrust) .also { - webInterface.core.distrustSone(currentSone, sone) + core.distrustSone(currentSone, sone) } } ?: createErrorJsonObject("invalid-sone-id")