🐛 Deduplicate items added to list notification
[Sone.git] / src / main / java / net / pterodactylus / sone / notify / ListNotification.java
index 11b0829..0c9e504 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - ListNotification.java - Copyright © 2010–2016 David Roden
+ * Sone - ListNotification.java - Copyright © 2010–2019 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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();
+               }
        }
 
        /**