projects
/
Sone.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
069a5d8
)
🐛 Fix sone-locked-on-startup handler
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Tue, 10 Dec 2019 15:48:37 +0000
(16:48 +0100)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Wed, 11 Dec 2019 15:59:14 +0000
(16:59 +0100)
src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt
patch
|
blob
|
history
src/main/kotlin/net/pterodactylus/sone/web/notification/SoneLockedOnStartupHandler.kt
patch
|
blob
|
history
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
4737267
..
a9e4ae8
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt
@@
-37,6
+37,7
@@
class NotificationHandlerModule : AbstractModule() {
override fun configure() {
bind(NotificationHandler::class.java).`in`(Singleton::class.java)
bind<MarkPostKnownDuringFirstStartHandler>().asSingleton()
override fun configure() {
bind(NotificationHandler::class.java).`in`(Singleton::class.java)
bind<MarkPostKnownDuringFirstStartHandler>().asSingleton()
+ bind<SoneLockedOnStartupHandler>().asSingleton()
}
@Provides
}
@Provides
@@
-44,11
+45,6
@@
class NotificationHandlerModule : AbstractModule() {
@Provides
@Singleton
@Provides
@Singleton
- fun getSoneLockedOnStartupHandler(notificationManager: NotificationManager, @Named("soneLockedOnStartup") notification: ListNotification<Sone>) =
- SoneLockedOnStartupHandler(notificationManager, notification)
-
- @Provides
- @Singleton
@Named("soneLockedOnStartup")
fun getSoneLockedOnStartupNotification(loaders: Loaders) =
ListNotification<Sone>("sone-locked-on-startup", "sones", loaders.loadTemplate("/templates/notify/soneLockedOnStartupNotification.html"))
@Named("soneLockedOnStartup")
fun getSoneLockedOnStartupNotification(loaders: Loaders) =
ListNotification<Sone>("sone-locked-on-startup", "sones", loaders.loadTemplate("/templates/notify/soneLockedOnStartupNotification.html"))
diff --git
a/src/main/kotlin/net/pterodactylus/sone/web/notification/SoneLockedOnStartupHandler.kt
b/src/main/kotlin/net/pterodactylus/sone/web/notification/SoneLockedOnStartupHandler.kt
index
aa3a417
..
c6de63f
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/web/notification/SoneLockedOnStartupHandler.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/web/notification/SoneLockedOnStartupHandler.kt
@@
-22,12
+22,13
@@
import net.pterodactylus.sone.core.event.*
import net.pterodactylus.sone.data.*
import net.pterodactylus.sone.notify.*
import net.pterodactylus.util.notify.*
import net.pterodactylus.sone.data.*
import net.pterodactylus.sone.notify.*
import net.pterodactylus.util.notify.*
+import javax.inject.*
/**
* Handler for [SoneLockedOnStartup][net.pterodactylus.sone.core.event.SoneLockedOnStartup] events
* that adds the appropriate notification to the [NotificationManager].
*/
/**
* Handler for [SoneLockedOnStartup][net.pterodactylus.sone.core.event.SoneLockedOnStartup] events
* that adds the appropriate notification to the [NotificationManager].
*/
-class SoneLockedOnStartupHandler
(private val notificationManager: NotificationManager,
private val notification: ListNotification<Sone>) {
+class SoneLockedOnStartupHandler
@Inject constructor(private val notificationManager: NotificationManager, @Named("soneLockedOnStartup")
private val notification: ListNotification<Sone>) {
@Subscribe
@Suppress("UnstableApiUsage")
@Subscribe
@Suppress("UnstableApiUsage")