From: David ‘Bombe’ Roden Date: Mon, 7 Mar 2011 16:17:54 +0000 (+0100) Subject: Add “loaded” member for posts and replies. X-Git-Tag: 0.4.4^2~5 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=15bae914fb87a6706530b9a8f5564d1a71901ecf;p=Sone.git Add “loaded” member for posts and replies. --- diff --git a/src/main/java/net/pterodactylus/sone/template/PostAccessor.java b/src/main/java/net/pterodactylus/sone/template/PostAccessor.java index 584cb72..ca0c84a 100644 --- a/src/main/java/net/pterodactylus/sone/template/PostAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/PostAccessor.java @@ -64,6 +64,8 @@ public class PostAccessor extends ReflectionAccessor { return core.isNewPost(post.getId()); } else if (member.equals("bookmarked")) { return core.isBookmarked(post); + } else if (member.equals("loaded")) { + return post.getSone() != null; } return super.get(templateContext, object, member); } diff --git a/src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java b/src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java index f439abe..1e54d53 100644 --- a/src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java @@ -58,6 +58,8 @@ public class ReplyAccessor extends ReflectionAccessor { return (currentSone != null) && (currentSone.isLikedReplyId(reply.getId())); } else if (member.equals("new")) { return core.isNewReply(reply.getId()); + } else if (member.equals("loaded")) { + return reply.getSone() != null; } return super.get(templateContext, object, member); }