X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=e245b6a945fb238eb621c087835bb7cc4b945019;hb=5bcc4f8e8d920408cf0c940ba67f6a1ebf9c4228;hp=258669af74dc6d292691036e8df12d6b18c041f3;hpb=53a71d1d6b91e4d56af49a06f2e06bc4d11bf3eb;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 258669a..e245b6a 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -64,6 +64,7 @@ import net.pterodactylus.sone.core.event.SoneUnlockedEvent; import net.pterodactylus.sone.core.event.UpdateFoundEvent; import net.pterodactylus.sone.data.Album; import net.pterodactylus.sone.data.Image; +import net.pterodactylus.sone.data.LocalSone; import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.data.Profile; @@ -381,7 +382,7 @@ public class WebInterface { * @return The currently logged in Sone, or {@code null} if no Sone is * currently logged in */ - public Optional getCurrentSone(ToadletContext toadletContext) { + public Optional getCurrentSone(ToadletContext toadletContext) { return getCurrentSone(toadletContext, true); } @@ -396,8 +397,8 @@ public class WebInterface { * @return The currently logged in Sone, or {@code null} if no Sone is * currently logged in */ - public Optional getCurrentSone(ToadletContext toadletContext, boolean createSession) { - Collection localSones = getCore().getLocalSones(); + public Optional getCurrentSone(ToadletContext toadletContext, boolean createSession) { + Collection localSones = getCore().getLocalSones(); if (localSones.size() == 1) { return Optional.of(localSones.iterator().next()); } @@ -412,7 +413,7 @@ public class WebInterface { * @return The currently logged in Sone, or {@code null} if no Sone is * currently logged in */ - public Optional getCurrentSone(Optional session) { + public Optional getCurrentSone(Optional session) { if (!session.isPresent()) { return Optional.absent(); } @@ -420,7 +421,7 @@ public class WebInterface { if (soneId == null) { return Optional.absent(); } - return Optional.fromNullable(getCore().getLocalSone(soneId)); + return getCore().getLocalSone(soneId); } /**