import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
+import com.google.common.collect.Collections2;
+
/**
* Page that displays all new posts and replies. The posts are filtered using
* {@link ListNotificationFilters#filterPosts(java.util.Collection, net.pterodactylus.sone.data.Sone)}
// SONETEMPLATEPAGE METHODS
//
- /**
- * {@inheritDoc}
- */
@Override
protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
super.processTemplate(request, templateContext);
/* collect new elements from notifications. */
Set<Post> posts = new HashSet<Post>(webInterface.getNewPosts());
- for (PostReply reply : webInterface.getNewReplies()) {
- posts.add(reply.getPost());
+ for (PostReply reply : Collections2.filter(webInterface.getNewReplies(), PostReply.HAS_POST_FILTER)) {
+ posts.add(reply.getPost().get());
}
/* filter and sort them. */