From 812bcc6f19f86cfcf2fddd21508f90286f80569f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 9 Nov 2014 16:01:11 +0100 Subject: [PATCH] =?utf8?q?Use=20=E2=80=9CisLoaded=E2=80=9D=20method=20to?= =?utf8?q?=20check=20whether=20a=20post=20is=20loaded.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../java/net/pterodactylus/sone/notify/ListNotificationFilters.java | 4 ++-- src/main/java/net/pterodactylus/sone/template/PostAccessor.java | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java index 5289081..f93e1f4 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java @@ -222,10 +222,10 @@ public class ListNotificationFilters { */ public static boolean isPostVisible(Sone sone, Post post) { checkNotNull(post, "post must not be null"); - Sone postSone = post.getSone(); - if (postSone == null) { + if (!post.isLoaded()) { return false; } + Sone postSone = post.getSone(); if (sone != null) { Trust trust = postSone.getIdentity().getTrust((OwnIdentity) sone.getIdentity()); if (trust != null) { diff --git a/src/main/java/net/pterodactylus/sone/template/PostAccessor.java b/src/main/java/net/pterodactylus/sone/template/PostAccessor.java index d593b51..78db678 100644 --- a/src/main/java/net/pterodactylus/sone/template/PostAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/PostAccessor.java @@ -67,8 +67,6 @@ public class PostAccessor extends ReflectionAccessor { 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); } -- 2.7.4