From 74a72a878cc5a6fe5805b3656c0ff6b726002124 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 23 Feb 2019 00:07:34 +0100 Subject: [PATCH] Remove unnecessary modifiers --- src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt | 2 +- src/main/kotlin/net/pterodactylus/sone/web/pages/ViewPostPage.kt | 2 +- src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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") -- 2.7.4