X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fnotify%2FListNotificationFilter.java;h=7084e66bf9a051ad4c364cf3302a17f29ee3fab1;hp=f3c93053c5feaad8cbb7d28a3937713ffd8a0a20;hb=b18bac64e8cdd43a34aa1449f6c335cdda463a0b;hpb=d36aa88de57f1492db61e3f6cb4daeeceab1904e diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java index f3c9305..7084e66 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java @@ -81,7 +81,7 @@ public class ListNotificationFilter { if (!currentSone.getOptions().isShowNewPostNotifications()) { continue; } - Optional> filteredNotification = filterNewPostNotification((ListNotification) notification, currentSone); + Optional> filteredNotification = filterPostNotification((ListNotification) notification, currentSone); if (filteredNotification.isPresent()) { filteredNotifications.add(filteredNotification.get()); } @@ -98,7 +98,7 @@ public class ListNotificationFilter { filteredNotifications.add(filteredNotification.get()); } } else if (notification.getId().equals("mention-notification")) { - Optional> filteredNotification = filterNewPostNotification((ListNotification) notification, null); + Optional> filteredNotification = filterPostNotification((ListNotification) notification, null); if (filteredNotification.isPresent()) { filteredNotifications.add(filteredNotification.get()); } @@ -119,7 +119,7 @@ public class ListNotificationFilter { * @return The filtered post notification, or {@link Optional#absent()} if the notification should be removed */ @Nonnull - private Optional> filterNewPostNotification(@Nonnull ListNotification postNotification, + private Optional> filterPostNotification(@Nonnull ListNotification postNotification, @Nullable Sone currentSone) { List newPosts = from(postNotification.getElements()).filter(postVisibilityFilter.isVisible(currentSone)).toList(); if (newPosts.isEmpty()) {