projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🚨 Suppress some warnings about unused parameters
[Sone.git]
/
src
/
main
/
kotlin
/
net
/
pterodactylus
/
sone
/
web
/
notification
/
LocalPostHandler.kt
diff --git
a/src/main/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandler.kt
b/src/main/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandler.kt
index
1ff4ea2
..
cd78dd0
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandler.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/web/notification/LocalPostHandler.kt
@@
-22,19
+22,20
@@
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 local posts.
*/
/**
* Handler for local posts.
*/
-class LocalPostHandler
(private val notificationManager: NotificationManager,
private val notification: ListNotification<Post>) {
+class LocalPostHandler
@Inject constructor(private val notificationManager: NotificationManager, @Named("localPost")
private val notification: ListNotification<Post>) {
@Subscribe
fun newPostFound(newPostFoundEvent: NewPostFoundEvent) {
newPostFoundEvent.post.onLocal { post ->
notification.add(post)
@Subscribe
fun newPostFound(newPostFoundEvent: NewPostFoundEvent) {
newPostFoundEvent.post.onLocal { post ->
notification.add(post)
- }
- if (!notificationManager.hasFirstStartNotification()) {
- notificationManager.addNotification(notification)
+ if (!notificationManager.hasFirstStartNotification()) {
+ notificationManager.addNotification(notification)
+ }
}
}
}
}