import com.google.common.base.Optional;
+import net.pterodactylus.sone.data.LocalSone;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.sone.web.page.FreenetRequest;
if (!sone.isPresent()) {
return createErrorJsonObject("invalid-sone-id");
}
- Sone currentSone = getCurrentSone(request.getToadletContext());
- if (currentSone == null) {
- return createErrorJsonObject("auth-required");
- }
+ LocalSone currentSone = getCurrentSone(request.getToadletContext()).get();
webInterface.getCore().followSone(currentSone, soneId);
webInterface.getCore().markSoneKnown(sone.get());
return createSuccessJsonObject();