X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNotificationHandlerModule.kt;h=0d7bb2561aa65980f155b48d5c8fa7534d6e147d;hb=1ad1aae2e29c608c5e1ab89e125bf2267fed18c6;hp=a3c10a6fc4f3cbbe540627665995e5ddbfe130eb;hpb=b31f0234988a509ca831785c87433ab264374d0a;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 a3c10a6..0d7bb25 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt @@ -24,6 +24,7 @@ import net.pterodactylus.sone.data.* import net.pterodactylus.sone.main.* import net.pterodactylus.sone.notify.* import net.pterodactylus.util.notify.* +import java.util.concurrent.* import java.util.concurrent.Executors.* import java.util.function.* import javax.inject.* @@ -46,6 +47,7 @@ class NotificationHandlerModule : AbstractModule() { bind().asSingleton() bind().asSingleton() bind().asSingleton() + bind().asSingleton() } @Provides @@ -75,10 +77,6 @@ class NotificationHandlerModule : AbstractModule() { ListNotification("sones-locked-notification", "sones", loaders.loadTemplate("/templates/notify/lockedSonesNotification.html"), dismissable = true) @Provides - fun getScheduledExecutorService() = - newScheduledThreadPool(1) - - @Provides @Singleton @Named("localPost") fun getLocalPostNotification(loaders: Loaders) = @@ -120,6 +118,12 @@ class NotificationHandlerModule : AbstractModule() { fun getConfigNotReadNotification(loaders: Loaders) = TemplateNotification("config-not-read-notification", loaders.loadTemplate("/templates/notify/configNotReadNotification.html")) + @Provides + @Singleton + @Named("startup") + fun getStartupNotification(loaders: Loaders) = + TemplateNotification("startup-notification", loaders.loadTemplate("/templates/notify/startupNotification.html")) + private inline fun bind(): AnnotatedBindingBuilder = bind(T::class.java) private fun ScopedBindingBuilder.asSingleton() = `in`(Singleton::class.java)