import com.google.common.base.Optional;
+import net.pterodactylus.sone.data.LocalSone;
import net.pterodactylus.sone.data.Post;
-import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.text.TextFilter;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.template.Template;
}
if (text.length() > 0) {
String senderId = request.getHttpRequest().getPartAsStringFailsafe("sender", 43);
- Sone sender = webInterface.getCore().getLocalSone(senderId, false);
- if (sender == null) {
+ Optional<LocalSone> sender = webInterface.getCore().getLocalSone(senderId);
+ if (!sender.isPresent()) {
sender = getCurrentSone(request.getToadletContext());
}
text = TextFilter.filter(request.getHttpRequest().getHeader("host"), text);
- webInterface.getCore().createReply(sender, post.get(), text);
+ webInterface.getCore().createReply(sender.get(), post.get(), text);
throw new RedirectException(returnPage);
}
templateContext.set("errorTextEmpty", true);