From: David ‘Bombe’ Roden Date: Sun, 9 Nov 2014 15:01:11 +0000 (+0100) Subject: Use “isLoaded” method to check whether a post is loaded. X-Git-Tag: 0.9-rc1^2~3^2~25 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=812bcc6f19f86cfcf2fddd21508f90286f80569f;p=Sone.git Use “isLoaded” method to check whether a post is loaded. --- 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); }