X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FTrustPage.kt;h=f8cb6dd249b4ade8f015be00d0eb6dab2be81ffc;hb=876c02e46d6c1f364bf824a8e3c9268b14845881;hp=b6fb03890577dc0e9b832415f42060964c2515d5;hpb=74cbe983cd38da24847e6247ac595cb70d8e115b;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt index b6fb038..f8cb6dd 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt @@ -7,19 +7,20 @@ 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 trust another Sone. This will assign a configurable * amount of trust to an identity. */ -class TrustPage(template: Template, webInterface: WebInterface): +class TrustPage @Inject constructor(template: Template, webInterface: WebInterface) : LoggedInPage("trust.html", template, "Page.Trust.Title", webInterface) { override fun handleRequest(freenetRequest: FreenetRequest, currentSone: Sone, templateContext: TemplateContext) { if (freenetRequest.isPOST) { - webInterface.core.getSone(freenetRequest.parameters["sone"]!!)?.let { sone -> - webInterface.core.trustSone(currentSone, sone) - } + webInterface.core.getSone(freenetRequest.parameters["sone"]!!)?.let { sone -> + webInterface.core.trustSone(currentSone, sone) + } throw RedirectException(freenetRequest.parameters["returnPage", 256]) } }