/**
* {@inheritDoc}
*/
@Override
public Object get(TemplateContext templateContext, Object object, String member) {
Post post = (Post) object;
if ("replies".equals(member)) {
return Collections2.filter(core.getReplies(post.getId()), Reply.FUTURE_REPLY_FILTER);
} else if (member.equals("likes")) {
return core.getLikes(post);
} else if (member.equals("liked")) {
Sone currentSone = (Sone) templateContext.get("currentSone");
return (currentSone != null) && (currentSone.isLikedPostId(post.getId()));
} else if (member.equals("new")) {
return !post.isKnown();
} else if (member.equals("bookmarked")) {
return core.isBookmarked(post);
} else if (member.equals("loaded")) {
return post.getSone() != null;
}
return super.get(templateContext, object, member);
}