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;
* @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);
}
* @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());
}
* @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();
}
if (soneId == null) {
return Optional.absent();
}
- return Optional.fromNullable(getCore().getLocalSone(soneId));
+ return getCore().getLocalSone(soneId);
}
/**