Loading feature/notification/api/src/commonMain/kotlin/net/thunderbird/feature/notification/api/command/NotificationCommand.kt +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ abstract class NotificationCommand<TNotification : Notification>( * Executes the command. * @return The result of the execution. */ abstract fun execute(): Outcome<Success<TNotification>, Failure<TNotification>> abstract suspend fun execute(): Outcome<Success<TNotification>, Failure<TNotification>> /** * Represents the outcome of a command's execution. Loading feature/notification/api/src/commonMain/kotlin/net/thunderbird/feature/notification/api/receiver/NotificationNotifier.kt +15 −1 Original line number Diff line number Diff line package net.thunderbird.feature.notification.api.receiver import net.thunderbird.feature.notification.api.NotificationId import net.thunderbird.feature.notification.api.content.Notification /** Loading @@ -10,5 +11,18 @@ import net.thunderbird.feature.notification.api.content.Notification * @param TNotification The type of notification to display. */ interface NotificationNotifier<in TNotification : Notification> { fun show(notification: TNotification) /** * Shows a notification to the user. * * @param id The notification id. Mostly used by System Notifications. * @param notification The notification to show. */ suspend fun show(id: NotificationId, notification: TNotification) /** * Disposes of any resources used by the notifier. * * This should be called when the notifier is no longer needed to prevent memory leaks. */ fun dispose() } feature/notification/impl/src/commonMain/kotlin/net/thunderbird/feature/notification/impl/command/InAppNotificationCommand.kt +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ internal class InAppNotificationCommand( notification: InAppNotification, notifier: NotificationNotifier<InAppNotification>, ) : NotificationCommand<InAppNotification>(notification, notifier) { override fun execute(): Outcome<Success<InAppNotification>, Failure<InAppNotification>> { override suspend fun execute(): Outcome<Success<InAppNotification>, Failure<InAppNotification>> { logger.debug { "TODO: Implementation on GitHub Issue #9245. Notification = $notification." } Loading feature/notification/impl/src/commonMain/kotlin/net/thunderbird/feature/notification/impl/command/SystemNotificationCommand.kt +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ internal class SystemNotificationCommand( notification: SystemNotification, notifier: NotificationNotifier<SystemNotification>, ) : NotificationCommand<SystemNotification>(notification, notifier) { override fun execute(): Outcome<Success<SystemNotification>, Failure<SystemNotification>> { override suspend fun execute(): Outcome<Success<SystemNotification>, Failure<SystemNotification>> { logger.debug { "TODO: Implementation on GitHub Issue #9245. Notification = $notification." } Loading feature/notification/impl/src/commonMain/kotlin/net/thunderbird/feature/notification/impl/receiver/InAppNotificationNotifier.kt +6 −1 Original line number Diff line number Diff line package net.thunderbird.feature.notification.impl.receiver import net.thunderbird.feature.notification.api.NotificationId import net.thunderbird.feature.notification.api.content.InAppNotification import net.thunderbird.feature.notification.api.receiver.NotificationNotifier Loading @@ -11,7 +12,11 @@ import net.thunderbird.feature.notification.api.receiver.NotificationNotifier * as part of GitHub Issue #9245. */ internal class InAppNotificationNotifier : NotificationNotifier<InAppNotification> { override fun show(notification: InAppNotification) { override suspend fun show(id: NotificationId, notification: InAppNotification) { TODO("Implementation on GitHub Issue #9245") } override fun dispose() { TODO("Implementation on GitHub Issue #9245") } } Loading
feature/notification/api/src/commonMain/kotlin/net/thunderbird/feature/notification/api/command/NotificationCommand.kt +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ abstract class NotificationCommand<TNotification : Notification>( * Executes the command. * @return The result of the execution. */ abstract fun execute(): Outcome<Success<TNotification>, Failure<TNotification>> abstract suspend fun execute(): Outcome<Success<TNotification>, Failure<TNotification>> /** * Represents the outcome of a command's execution. Loading
feature/notification/api/src/commonMain/kotlin/net/thunderbird/feature/notification/api/receiver/NotificationNotifier.kt +15 −1 Original line number Diff line number Diff line package net.thunderbird.feature.notification.api.receiver import net.thunderbird.feature.notification.api.NotificationId import net.thunderbird.feature.notification.api.content.Notification /** Loading @@ -10,5 +11,18 @@ import net.thunderbird.feature.notification.api.content.Notification * @param TNotification The type of notification to display. */ interface NotificationNotifier<in TNotification : Notification> { fun show(notification: TNotification) /** * Shows a notification to the user. * * @param id The notification id. Mostly used by System Notifications. * @param notification The notification to show. */ suspend fun show(id: NotificationId, notification: TNotification) /** * Disposes of any resources used by the notifier. * * This should be called when the notifier is no longer needed to prevent memory leaks. */ fun dispose() }
feature/notification/impl/src/commonMain/kotlin/net/thunderbird/feature/notification/impl/command/InAppNotificationCommand.kt +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ internal class InAppNotificationCommand( notification: InAppNotification, notifier: NotificationNotifier<InAppNotification>, ) : NotificationCommand<InAppNotification>(notification, notifier) { override fun execute(): Outcome<Success<InAppNotification>, Failure<InAppNotification>> { override suspend fun execute(): Outcome<Success<InAppNotification>, Failure<InAppNotification>> { logger.debug { "TODO: Implementation on GitHub Issue #9245. Notification = $notification." } Loading
feature/notification/impl/src/commonMain/kotlin/net/thunderbird/feature/notification/impl/command/SystemNotificationCommand.kt +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ internal class SystemNotificationCommand( notification: SystemNotification, notifier: NotificationNotifier<SystemNotification>, ) : NotificationCommand<SystemNotification>(notification, notifier) { override fun execute(): Outcome<Success<SystemNotification>, Failure<SystemNotification>> { override suspend fun execute(): Outcome<Success<SystemNotification>, Failure<SystemNotification>> { logger.debug { "TODO: Implementation on GitHub Issue #9245. Notification = $notification." } Loading
feature/notification/impl/src/commonMain/kotlin/net/thunderbird/feature/notification/impl/receiver/InAppNotificationNotifier.kt +6 −1 Original line number Diff line number Diff line package net.thunderbird.feature.notification.impl.receiver import net.thunderbird.feature.notification.api.NotificationId import net.thunderbird.feature.notification.api.content.InAppNotification import net.thunderbird.feature.notification.api.receiver.NotificationNotifier Loading @@ -11,7 +12,11 @@ import net.thunderbird.feature.notification.api.receiver.NotificationNotifier * as part of GitHub Issue #9245. */ internal class InAppNotificationNotifier : NotificationNotifier<InAppNotification> { override fun show(notification: InAppNotification) { override suspend fun show(id: NotificationId, notification: InAppNotification) { TODO("Implementation on GitHub Issue #9245") } override fun dispose() { TODO("Implementation on GitHub Issue #9245") } }