/**
- * Sone - NewLocalPostHandler.kt - Copyright © 2019 David ‘Bombe’ Roden
+ * Sone - LocalPostHandler.kt - Copyright © 2019–2020 David ‘Bombe’ Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import net.pterodactylus.sone.data.*
import net.pterodactylus.sone.notify.*
import net.pterodactylus.util.notify.*
+import javax.inject.*
/**
* 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)
- }
- if (!notificationManager.hasFirstStartNotification()) {
- notificationManager.addNotification(notification)
+ if (!notificationManager.hasFirstStartNotification()) {
+ notificationManager.addNotification(notification)
+ }
}
}