redirectIfNotNull(getImageId(phrase), "imageBrowser.html?image=");
}
- Set<Sone> sones = webInterface.getCore().getSones();
+ Collection<Sone> sones = webInterface.getCore().getSones();
Collection<Hit<Sone>> soneHits = getHits(sones, phrases, SoneStringGenerator.COMPLETE_GENERATOR);
Collection<Hit<Post>> postHits = hitCache.getUnchecked(phrases);
*/
private String getSoneId(String phrase) {
String soneId = phrase.startsWith("sone://") ? phrase.substring(7) : phrase;
- return (webInterface.getCore().getSone(soneId, false) != null) ? soneId : null;
+ return (webInterface.getCore().getSone(soneId).isPresent()) ? soneId : null;
}
/**
public String generateString(Post post) {
StringBuilder postString = new StringBuilder();
postString.append(post.getText());
- if (post.getRecipient() != null) {
- postString.append(' ').append(SoneStringGenerator.NAME_GENERATOR.generateString(post.getRecipient()));
+ if (post.getRecipient().isPresent()) {
+ postString.append(' ').append(SoneStringGenerator.NAME_GENERATOR.generateString(post.getRecipient().get()));
}
- for (PostReply reply : Collections2.filter(webInterface.getCore().getReplies(post), Reply.FUTURE_REPLY_FILTER)) {
+ for (PostReply reply : Collections2.filter(webInterface.getCore().getReplies(post.getId()), Reply.FUTURE_REPLY_FILTER)) {
postString.append(' ').append(SoneStringGenerator.NAME_GENERATOR.generateString(reply.getSone()));
postString.append(' ').append(reply.getText());
}