X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FDistrustPage.kt;h=f2115e52bb14b8393a99e50e9fb662a9454465cb;hb=HEAD;hp=c312a70e1316878c363b2feac725a99c78288fab;hpb=1fc003ab87ca2f5dd2d4215289f578b6177cd324;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt deleted file mode 100644 index c312a70..0000000 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt +++ /dev/null @@ -1,28 +0,0 @@ -package net.pterodactylus.sone.web.pages - -import net.pterodactylus.sone.data.Sone -import net.pterodactylus.sone.utils.isPOST -import net.pterodactylus.sone.web.WebInterface -import net.pterodactylus.sone.web.page.FreenetRequest -import net.pterodactylus.util.template.Template -import net.pterodactylus.util.template.TemplateContext -import javax.inject.Inject - -/** - * Page that lets the user distrust another Sone. This will assign a - * configurable (negative) amount of trust to an identity. - * - * @see net.pterodactylus.sone.core.Core#distrustSone(Sone, Sone) - */ -class DistrustPage @Inject constructor(template: Template, webInterface: WebInterface): - LoggedInPage("distrust.html", template, "Page.Distrust.Title", webInterface) { - - override fun handleRequest(freenetRequest: FreenetRequest, currentSone: Sone, templateContext: TemplateContext) { - if (freenetRequest.isPOST) { - webInterface.core.getSone(freenetRequest.httpRequest.getPartAsStringFailsafe("sone", 44)) - ?.run { webInterface.core.distrustSone(currentSone, this) } - throw RedirectException(freenetRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)) - } - } - -}