Add “loaded” member for posts and replies.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 7 Mar 2011 16:17:54 +0000 (17:17 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 7 Mar 2011 16:17:54 +0000 (17:17 +0100)
src/main/java/net/pterodactylus/sone/template/PostAccessor.java
src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java

index 584cb72..ca0c84a 100644 (file)
@@ -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);
        }
index f439abe..1e54d53 100644 (file)
@@ -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);
        }