Return local Sones from core and web interface.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / WebInterface.java
index 258669a..e245b6a 100644 (file)
@@ -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<Sone> getCurrentSone(ToadletContext toadletContext) {
+       public Optional<LocalSone> 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<Sone> getCurrentSone(ToadletContext toadletContext, boolean createSession) {
-               Collection<Sone> localSones = getCore().getLocalSones();
+       public Optional<LocalSone> getCurrentSone(ToadletContext toadletContext, boolean createSession) {
+               Collection<LocalSone> 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<Sone> getCurrentSone(Optional<Session> session) {
+       public Optional<LocalSone> getCurrentSone(Optional<Session> 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);
        }
 
        /**