Filter mention notifications separately.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Jul 2011 12:30:42 +0000 (14:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Jul 2011 12:30:42 +0000 (14:30 +0200)
src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java

index 908ea2b..52f85ba 100644 (file)
@@ -54,7 +54,7 @@ public class ListNotificationFilters {
        public static List<Notification> filterNotifications(Collection<? extends Notification> notifications, Sone currentSone) {
                List<Notification> filteredNotifications = new ArrayList<Notification>();
                for (Notification notification : notifications) {
        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") || notification.getId().equals("mention-notification")) {
+                       if (notification.getId().equals("new-post-notification")) {
                                ListNotification<Post> filteredNotification = filterNewPostNotification((ListNotification<Post>) notification, currentSone);
                                if (filteredNotification != null) {
                                        filteredNotifications.add(filteredNotification);
                                ListNotification<Post> filteredNotification = filterNewPostNotification((ListNotification<Post>) notification, currentSone);
                                if (filteredNotification != null) {
                                        filteredNotifications.add(filteredNotification);
@@ -64,6 +64,11 @@ public class ListNotificationFilters {
                                if (filteredNotification != null) {
                                        filteredNotifications.add(filteredNotification);
                                }
                                if (filteredNotification != null) {
                                        filteredNotifications.add(filteredNotification);
                                }
+                       } else if (notification.getId().equals("mention-notification")) {
+                               ListNotification<Post> filteredNotification = filterNewPostNotification((ListNotification<Post>) notification, null);
+                               if (filteredNotification != null) {
+                                       filteredNotifications.add(filteredNotification);
+                               }
                        } else {
                                filteredNotifications.add(notification);
                        }
                        } else {
                                filteredNotifications.add(notification);
                        }