From 15bae914fb87a6706530b9a8f5564d1a71901ecf Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 7 Mar 2011 17:17:54 +0100 Subject: [PATCH] =?utf8?q?Add=20=E2=80=9Cloaded=E2=80=9D=20member=20for=20?= =?utf8?q?posts=20and=20replies.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/template/PostAccessor.java | 2 ++ src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java | 2 ++ 2 files changed, 4 insertions(+) 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); } -- 2.7.4