public static List<Notification> filterNotifications(Collection<? extends Notification> notifications, Sone currentSone) {
List<Notification> filteredNotifications = new ArrayList<Notification>();
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<Post> filteredNotification = filterNewPostNotification((ListNotification<Post>) 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<PostReply> filteredNotification = filterNewReplyNotification((ListNotification<PostReply>) notification, currentSone);
if (filteredNotification != null) {
filteredNotifications.add(filteredNotification);