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:
f77867b
)
🐛 Fix new-sone handler
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Tue, 10 Dec 2019 15:50:49 +0000
(16:50 +0100)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Wed, 11 Dec 2019 15:59:15 +0000
(16:59 +0100)
src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt
patch
|
blob
|
history
src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt
patch
|
blob
|
history
diff --git
a/src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt
b/src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt
index
a420f14
..
f47d456
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt
@@
-22,11
+22,12
@@
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.*
/**
* Notification handler for “new Sone discovered” events.
*/
/**
* Notification handler for “new Sone discovered” events.
*/
-class NewSoneHandler
(private val notificationManager: NotificationManager,
private val notification: ListNotification<Sone>) {
+class NewSoneHandler
@Inject constructor(private val notificationManager: NotificationManager, @Named("newSone")
private val notification: ListNotification<Sone>) {
@Subscribe
fun newSoneFound(newSoneFoundEvent: NewSoneFoundEvent) {
@Subscribe
fun newSoneFound(newSoneFoundEvent: NewSoneFoundEvent) {
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
a9e4ae8
..
522e983
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt
@@
-38,6
+38,7
@@
class NotificationHandlerModule : AbstractModule() {
bind(NotificationHandler::class.java).`in`(Singleton::class.java)
bind<MarkPostKnownDuringFirstStartHandler>().asSingleton()
bind<SoneLockedOnStartupHandler>().asSingleton()
bind(NotificationHandler::class.java).`in`(Singleton::class.java)
bind<MarkPostKnownDuringFirstStartHandler>().asSingleton()
bind<SoneLockedOnStartupHandler>().asSingleton()
+ bind<NewSoneHandler>().asSingleton()
}
@Provides
}
@Provides
@@
-50,11
+51,6
@@
class NotificationHandlerModule : AbstractModule() {
ListNotification<Sone>("sone-locked-on-startup", "sones", loaders.loadTemplate("/templates/notify/soneLockedOnStartupNotification.html"))
@Provides
ListNotification<Sone>("sone-locked-on-startup", "sones", loaders.loadTemplate("/templates/notify/soneLockedOnStartupNotification.html"))
@Provides
- @Singleton
- fun getNewSoneHandler(notificationManager: NotificationManager, @Named("newSone") notification: ListNotification<Sone>) =
- NewSoneHandler(notificationManager, notification)
-
- @Provides
@Named("newSone")
fun getNewSoneNotification(loaders: Loaders) =
ListNotification<Sone>("new-sone-notification", "sones", loaders.loadTemplate("/templates/notify/newSoneNotification.html"), dismissable = false)
@Named("newSone")
fun getNewSoneNotification(loaders: Loaders) =
ListNotification<Sone>("new-sone-notification", "sones", loaders.loadTemplate("/templates/notify/newSoneNotification.html"), dismissable = false)