X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fnotify%2FListNotification.kt;h=9ee328ed2830c730d70e64c2b4feef5558dd3cb1;hb=80a85fb800467a7041517ed1901b59d8a3f2cccd;hp=dccc43082c412e2f0d47cdc3d8c7ec69faaf0392;hpb=57beeb2a70c1c0f60c6a22d73e68815982e20d6d;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/notify/ListNotification.kt b/src/main/kotlin/net/pterodactylus/sone/notify/ListNotification.kt index dccc430..9ee328e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/notify/ListNotification.kt +++ b/src/main/kotlin/net/pterodactylus/sone/notify/ListNotification.kt @@ -41,18 +41,18 @@ class ListNotification : TemplateNotification { @JvmOverloads constructor(id: String, key: String, template: Template, dismissable: Boolean = true) : super(id, currentTimeMillis(), currentTimeMillis(), dismissable, template) { this.key = key - template.initialContext.set(key, elements) + template.initialContext.set(key, realElements) } constructor(listNotification: ListNotification) : super(listNotification.id, listNotification.createdTime, listNotification.lastUpdatedTime, listNotification.isDismissable, Template()) { this.key = listNotification.key template.add(listNotification.template) - template.initialContext.set(key, elements) + template.initialContext.set(key, realElements) } fun setElements(elements: Collection) { realElements.clear() - realElements.addAll(elements) + realElements.addAll(elements.distinct()) touch() }