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.*
bind<ImageInsertHandler>().asSingleton()
bind<FirstStartHandler>().asSingleton()
bind<ConfigNotReadHandler>().asSingleton()
+ bind<StartupHandler>().asSingleton()
}
@Provides
ListNotification<Sone>("sones-locked-notification", "sones", loaders.loadTemplate("/templates/notify/lockedSonesNotification.html"), dismissable = true)
@Provides
- fun getScheduledExecutorService() =
+ fun getScheduledExecutorService(): ScheduledExecutorService =
newScheduledThreadPool(1)
@Provides
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 <reified T> bind(): AnnotatedBindingBuilder<T> = bind(T::class.java)
private fun ScopedBindingBuilder.asSingleton() = `in`(Singleton::class.java)