projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🚧 Use ticker from Sone module for notifications
[Sone.git]
/
src
/
main
/
kotlin
/
net
/
pterodactylus
/
sone
/
web
/
notification
/
NotificationHandlerModule.kt
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
(file)
--- 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 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.*
import java.util.concurrent.Executors.*
import java.util.function.*
import javax.inject.*
@@
-46,6
+47,7
@@
class NotificationHandlerModule : AbstractModule() {
bind<ImageInsertHandler>().asSingleton()
bind<FirstStartHandler>().asSingleton()
bind<ConfigNotReadHandler>().asSingleton()
bind<ImageInsertHandler>().asSingleton()
bind<FirstStartHandler>().asSingleton()
bind<ConfigNotReadHandler>().asSingleton()
+ bind<StartupHandler>().asSingleton()
}
@Provides
}
@Provides
@@
-75,10
+77,6
@@
class NotificationHandlerModule : AbstractModule() {
ListNotification<Sone>("sones-locked-notification", "sones", loaders.loadTemplate("/templates/notify/lockedSonesNotification.html"), dismissable = true)
@Provides
ListNotification<Sone>("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) =
@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"))
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)
private inline fun <reified T> bind(): AnnotatedBindingBuilder<T> = bind(T::class.java)
private fun ScopedBindingBuilder.asSingleton() = `in`(Singleton::class.java)