From: David ‘Bombe’ Roden Date: Fri, 22 Feb 2019 23:07:34 +0000 (+0100) Subject: Remove unnecessary modifiers X-Git-Tag: v79^2~102 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=74a72a878cc5a6fe5805b3656c0ff6b726002124;p=Sone.git Remove unnecessary modifiers --- diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt index 37b1107..c6c50bb 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt @@ -29,7 +29,7 @@ class LoginPage @Inject constructor(template: Template, webInterface: WebInterfa templateContext["identitiesWithoutSone"] = webInterface.core.identityManager.allOwnIdentities.filterNot { "Sone" in it.contexts }.sortedBy { "${it.nickname}@${it.id}" } } - override public fun getRedirectTarget(freenetRequest: FreenetRequest) = + override fun getRedirectTarget(freenetRequest: FreenetRequest) = getCurrentSone(freenetRequest.toadletContext)?.let { "index.html" } override fun isEnabled(toadletContext: ToadletContext) = when { diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt index 763fc99..0856e86 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt @@ -23,7 +23,7 @@ class ViewPostPage @Inject constructor(template: Template, webInterface: WebInte override fun isLinkExcepted(link: URI?) = true - public override fun getPageTitle(freenetRequest: FreenetRequest) = + override fun getPageTitle(freenetRequest: FreenetRequest) = (freenetRequest.parameters["post"]?.let(webInterface.core::getPost)?.let { if (it.text.length > 20) { it.text.substring(0..19) + "…" diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt index ef0d3f5..145be72 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt @@ -50,7 +50,7 @@ class ViewSonePage @Inject constructor(template: Template, webInterface: WebInte override fun isLinkExcepted(link: URI?) = true - public override fun getPageTitle(freenetRequest: FreenetRequest): String = + override fun getPageTitle(freenetRequest: FreenetRequest): String = freenetRequest.parameters["sone"]!!.let(webInterface.core::getSone)?.let { sone -> "${SoneAccessor.getNiceName(sone)} - ${webInterface.l10n.getString("Page.ViewSone.Title")}" } ?: webInterface.l10n.getString("Page.ViewSone.Page.TitleWithoutSone")