X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNewRemotePostHandler.kt;h=91eaae00f744dd8fb042bc085f255e288590bc17;hb=faf66247a34f64946990a985d2ea3003465969cb;hp=0c2368a8606faa8ee05625aadac1463197c3d32c;hpb=146335994dc415527bc4c8ec9a0981d739444ea8;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandler.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandler.kt index 0c2368a..91eaae0 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandler.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandler.kt @@ -1,5 +1,5 @@ /** - * Sone - NewRemotePostHandler.kt - Copyright © 2019 David ‘Bombe’ Roden + * Sone - NewRemotePostHandler.kt - Copyright © 2019–2020 David ‘Bombe’ 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 @@ -40,4 +40,14 @@ class NewRemotePostHandler @Inject constructor(private val notificationManager: } } + @Subscribe + fun postRemoved(event: PostRemovedEvent) { + notification.remove(event.post) + } + + @Subscribe + fun postMarkedKnown(event: MarkPostKnownEvent) { + notification.remove(event.post) + } + }