X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fnotify%2FListNotificationFilters.java;h=1261fc994ebf4082b8eb3ebd9e67b8320386b798;hb=961a1cfe36ab3b4f6d74931b16098071eb6aaa95;hp=1d4aa68fc2242693f30c5074f8529458b223e87e;hpb=419098bcd6215125408b29e60bd888e60979d37b;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java index 1d4aa68..1261fc9 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java @@ -108,7 +108,7 @@ public class ListNotificationFilters { * @return The filtered new-post notification, or {@code null} if the * notification should be removed */ - public static ListNotification filterNewPostNotification(ListNotification newPostNotification, Sone currentSone, boolean soneRequired) { + private static ListNotification filterNewPostNotification(ListNotification newPostNotification, Sone currentSone, boolean soneRequired) { if (soneRequired && (currentSone == null)) { return null; } @@ -144,7 +144,7 @@ public class ListNotificationFilters { * @return The filtered new-reply notification, or {@code null} if the * notification should be removed */ - public static ListNotification filterNewReplyNotification(ListNotification newReplyNotification, Sone currentSone) { + private static ListNotification filterNewReplyNotification(ListNotification newReplyNotification, Sone currentSone) { if (currentSone == null) { return null; } @@ -248,10 +248,7 @@ public class ListNotificationFilters { return false; } } - if (post.getTime() > System.currentTimeMillis()) { - return false; - } - return true; + return post.getTime() <= System.currentTimeMillis(); } /** @@ -290,10 +287,7 @@ public class ListNotificationFilters { if (!isPostVisible(sone, post.get())) { return false; } - if (reply.getTime() > System.currentTimeMillis()) { - return false; - } - return true; + return reply.getTime() <= System.currentTimeMillis(); } }