X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNotificationHandlerModule.kt;h=7918758f0ce7158969db1ad7c4dc02164918d125;hb=6d770b3aa761b4432517b4789a980c4ba75ed9fa;hp=522e9833ace512e8c84c08d9bd8845ae762bbfee;hpb=0831ce844d421828bd9a4dc12f33ba58f9990c25;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt index 522e983..7918758 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt @@ -23,7 +23,6 @@ import net.pterodactylus.sone.core.* import net.pterodactylus.sone.data.* import net.pterodactylus.sone.main.* import net.pterodactylus.sone.notify.* -import net.pterodactylus.util.notify.* import java.util.concurrent.Executors.* import java.util.function.* import javax.inject.* @@ -39,6 +38,8 @@ class NotificationHandlerModule : AbstractModule() { bind().asSingleton() bind().asSingleton() bind().asSingleton() + bind().asSingleton() + bind().asSingleton() } @Provides @@ -57,11 +58,6 @@ class NotificationHandlerModule : AbstractModule() { @Provides @Singleton - fun getNewRemotePostHandler(notificationManager: NotificationManager, @Named("newRemotePost") newPostNotification: ListNotification) = - NewRemotePostHandler(notificationManager, newPostNotification) - - @Provides - @Singleton @Named("newRemotePost") fun getNewPostNotification(loaders: Loaders) = ListNotification("new-post-notification", "posts", loaders.loadTemplate("/templates/notify/newPostNotification.html"), dismissable = false) @@ -73,9 +69,8 @@ class NotificationHandlerModule : AbstractModule() { ListNotification("sones-locked-notification", "sones", loaders.loadTemplate("/templates/notify/lockedSonesNotification.html"), dismissable = true) @Provides - @Singleton - fun getSoneLockedHandler(notificationManager: NotificationManager, @Named("soneLocked") soneLockedNotification: ListNotification) = - SoneLockedHandler(notificationManager, soneLockedNotification, newScheduledThreadPool(1)) + fun getScheduledExecutorService() = + newScheduledThreadPool(1) private inline fun bind(): AnnotatedBindingBuilder = bind(T::class.java) private fun ScopedBindingBuilder.asSingleton() = `in`(Singleton::class.java)