From: David ‘Bombe’ Roden Date: Fri, 11 Nov 2011 09:16:27 +0000 (+0100) Subject: Filter notifications that the user is not interested in. X-Git-Tag: 0.7.3^2~14^2~4 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=7767adb4bf17f4170989f95af5eb3dde42a2fc00 Filter notifications that the user is not interested in. --- diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java index beeb81e..7175519 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java @@ -55,12 +55,14 @@ public class ListNotificationFilters { public static List filterNotifications(Collection notifications, Sone currentSone) { List filteredNotifications = new ArrayList(); for (Notification notification : notifications) { - if (notification.getId().equals("new-post-notification")) { + if (notification.getId().equals("new-sone-notification") && ((currentSone == null) || (currentSone.getOptions().getBooleanOption("ShowNotification/NewSones").get()))) { + filteredNotifications.add(notification); + } else if (notification.getId().equals("new-post-notification") && ((currentSone == null) || (currentSone.getOptions().getBooleanOption("ShowNotification/NewPosts").get()))) { ListNotification filteredNotification = filterNewPostNotification((ListNotification) notification, currentSone, true); if (filteredNotification != null) { filteredNotifications.add(filteredNotification); } - } else if (notification.getId().equals("new-reply-notification")) { + } else if (notification.getId().equals("new-reply-notification") && ((currentSone == null) || (currentSone.getOptions().getBooleanOption("ShowNotification/NewReplies").get()))) { ListNotification filteredNotification = filterNewReplyNotification((ListNotification) notification, currentSone); if (filteredNotification != null) { filteredNotifications.add(filteredNotification);