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:
0831ce8
)
š Fix new-remote-post handler
author
David āBombeā Roden
<bombe@pterodactylus.net>
Tue, 10 Dec 2019 15:51:52 +0000
(16:51 +0100)
committer
David āBombeā Roden
<bombe@pterodactylus.net>
Wed, 11 Dec 2019 15:59:16 +0000
(16:59 +0100)
src/main/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandler.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/NewRemotePostHandler.kt
b/src/main/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandler.kt
index
1127fea
..
0c2368a
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandler.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandler.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 [NewPostFoundEvent]s that adds the new post to the ānew postsā notification and
* displays the notification if the āfirst startā notification is not being shown.
*/
/**
* Handler for [NewPostFoundEvent]s that adds the new post to the ānew postsā notification and
* displays the notification if the āfirst startā notification is not being shown.
*/
-class NewRemotePostHandler
(private val notificationManager: NotificationManager,
private val notification: ListNotification<Post>) {
+class NewRemotePostHandler
@Inject constructor(private val notificationManager: NotificationManager, @Named("newRemotePost")
private val notification: ListNotification<Post>) {
@Subscribe
fun newPostFound(newPostFoundEvent: NewPostFoundEvent) {
@Subscribe
fun newPostFound(newPostFoundEvent: NewPostFoundEvent) {
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
522e983
..
c75cbc1
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModule.kt
@@
-39,6
+39,7
@@
class NotificationHandlerModule : AbstractModule() {
bind<MarkPostKnownDuringFirstStartHandler>().asSingleton()
bind<SoneLockedOnStartupHandler>().asSingleton()
bind<NewSoneHandler>().asSingleton()
bind<MarkPostKnownDuringFirstStartHandler>().asSingleton()
bind<SoneLockedOnStartupHandler>().asSingleton()
bind<NewSoneHandler>().asSingleton()
+ bind<NewRemotePostHandler>().asSingleton()
}
@Provides
}
@Provides
@@
-57,11
+58,6
@@
class NotificationHandlerModule : AbstractModule() {
@Provides
@Singleton
@Provides
@Singleton
- fun getNewRemotePostHandler(notificationManager: NotificationManager, @Named("newRemotePost") newPostNotification: ListNotification<Post>) =
- NewRemotePostHandler(notificationManager, newPostNotification)
-
- @Provides
- @Singleton
@Named("newRemotePost")
fun getNewPostNotification(loaders: Loaders) =
ListNotification<Post>("new-post-notification", "posts", loaders.loadTemplate("/templates/notify/newPostNotification.html"), dismissable = false)
@Named("newRemotePost")
fun getNewPostNotification(loaders: Loaders) =
ListNotification<Post>("new-post-notification", "posts", loaders.loadTemplate("/templates/notify/newPostNotification.html"), dismissable = false)