- Set<Reply> newReplies = webInterface.getNewReplies();
- JsonArray jsonReplies = new JsonArray();
- for (Reply reply : newReplies) {
- JsonObject jsonReply = new JsonObject();
+ Collection<PostReply> newReplies = webInterface.getNewReplies();
+ if (currentSone != null) {
+ newReplies = Collections2.filter(newReplies, new Predicate<PostReply>() {
+
+ @Override
+ public boolean apply(PostReply reply) {
+ return ListNotificationFilters.isReplyVisible(currentSone, reply);
+ }
+
+ });
+ }
+ /* remove replies to unknown posts. */
+ newReplies = Collections2.filter(newReplies, PostReply.HAS_POST_FILTER);
+ ArrayNode jsonReplies = new ArrayNode(instance);
+ for (PostReply reply : newReplies) {
+ ObjectNode jsonReply = new ObjectNode(instance);