X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNotificationHandler.kt;h=a24a6d8bad8912a2b7a6a3947a79500a9afa073b;hp=7f81f9a74fdbac99fadebf783e8c40d51d27576c;hb=438378deab1514f0f608d975ef65f5b7aea44ccb;hpb=c2749a08af5f846c7285c0bb6a930f372bd7f9cb diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandler.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandler.kt index 7f81f9a..a24a6d8 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandler.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/NotificationHandler.kt @@ -1,5 +1,5 @@ /** - * Sone - NotificationHandler.kt - Copyright © 2019 David ‘Bombe’ Roden + * Sone - NotificationHandler.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 @@ -17,20 +17,33 @@ package net.pterodactylus.sone.web.notification -import com.google.common.eventbus.* -import net.pterodactylus.sone.main.* -import net.pterodactylus.util.notify.* +import net.pterodactylus.sone.freenet.wot.* +import net.pterodactylus.sone.text.* import javax.inject.* /** - * Handler for notifications that can create notifications and register them with an event bus. + * Container that causes notification handlers to be created and (more importantly) registered + * on creation with the event bus. */ -@Suppress("UnstableApiUsage") -class NotificationHandler @Inject constructor(private val eventBus: EventBus, private val loaders: Loaders, private val notificationManager: NotificationManager) { - - fun start() { - SoneLockedOnStartupHandler(notificationManager, loaders.loadTemplate("/templates/notify/soneLockedOnStartupNotification.html")) - .also(eventBus::register) - } - -} +@Suppress("UNUSED_PARAMETER") +class NotificationHandler @Inject constructor( + markPostKnownDuringFirstStartHandler: MarkPostKnownDuringFirstStartHandler, + markPostReplyKnownDuringFirstStartHandler: MarkPostReplyKnownDuringFirstStartHandler, + newSoneHandler: NewSoneHandler, + newRemotePostHandler: NewRemotePostHandler, + remotePostReplyHandler: RemotePostReplyHandler, + soneLockedOnStartupHandler: SoneLockedOnStartupHandler, + soneLockedHandler: SoneLockedHandler, + localPostHandler: LocalPostHandler, + localReplyHandler: LocalReplyHandler, + newVersionHandler: NewVersionHandler, + imageInsertHandler: ImageInsertHandler, + firstStartHandler: FirstStartHandler, + configNotReadHandler: ConfigNotReadHandler, + startupHandler: StartupHandler, + webOfTrustPinger: WebOfTrustPinger, + webOfTrustHandler: WebOfTrustHandler, + soneMentionDetector: SoneMentionDetector, + soneMentionedHandler: SoneMentionedHandler, + soneInsertHandler: SoneInsertHandler +)