From 399632073484e68c7664af6b24f6fe45fdbbb6dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 7 Apr 2020 20:29:47 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=94=A5=20Remove=20=E2=80=9Ccreate=E2=80=9D?= =?utf8?q?=20flag=20from=20session=20provider=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/WebInterface.java | 4 ++-- src/main/kotlin/net/pterodactylus/sone/web/SessionProvider.kt | 2 +- src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt | 4 ++-- src/main/kotlin/net/pterodactylus/sone/web/pages/SoneTemplatePage.kt | 2 +- src/test/kotlin/net/pterodactylus/sone/web/ajax/TestObjects.kt | 4 ++-- src/test/kotlin/net/pterodactylus/sone/web/pages/WebPageTest.kt | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 5448054..d8d5e26 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -265,8 +265,8 @@ public class WebInterface implements SessionProvider { @Override @Nullable - public Sone getCurrentSone(@Nonnull ToadletContext toadletContext, boolean createSession) { - return createSession ? getCurrentSoneCreatingSession(toadletContext) : getCurrentSoneWithoutCreatingSession(toadletContext); + public Sone getCurrentSone(@Nonnull ToadletContext toadletContext) { + return getCurrentSoneWithoutCreatingSession(toadletContext); } /** diff --git a/src/main/kotlin/net/pterodactylus/sone/web/SessionProvider.kt b/src/main/kotlin/net/pterodactylus/sone/web/SessionProvider.kt index 463ddaa..93cd6af 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/SessionProvider.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/SessionProvider.kt @@ -8,7 +8,7 @@ import net.pterodactylus.sone.data.Sone */ interface SessionProvider { - fun getCurrentSone(toadletContext: ToadletContext, createSession: Boolean = true): Sone? + fun getCurrentSone(toadletContext: ToadletContext): Sone? fun setCurrentSone(toadletContext: ToadletContext, sone: Sone?) } diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt index 99c0828..574a0a8 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt @@ -32,7 +32,7 @@ abstract class JsonPage(protected val webInterface: WebInterface) : Page