🐛 Deduplicate items added to list notification
[Sone.git] / src / main / java / net / pterodactylus / sone / notify / ListNotification.java
index 6a7b086..0c9e504 100644 (file)
@@ -129,8 +129,10 @@ public class ListNotification<T> extends TemplateNotification {
         *            The new element
         */
        public void add(T element) {
-               elements.add(element);
-               touch();
+               if (!elements.contains(element)) {
+                       elements.add(element);
+                       touch();
+               }
        }
 
        /**