From 7c49e42d4341eea4b76ffb5aad7847d784c0df6a Mon Sep 17 00:00:00 2001 From: Baptiste Candellier Date: Sun, 23 Apr 2023 20:51:14 +0200 Subject: [PATCH] feat(notification): re-use standard notification strategy on desktop --- .../java/fr/outadoc/justchatting/di/ChatModule.kt | 12 ++---------- .../chat/presentation/mobile/NoOpChatNotifier.kt | 14 -------------- 2 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 feature-chat-presentation-mobile/src/main/java/fr/outadoc/justchatting/feature/chat/presentation/mobile/NoOpChatNotifier.kt diff --git a/app/src/main/java/fr/outadoc/justchatting/di/ChatModule.kt b/app/src/main/java/fr/outadoc/justchatting/di/ChatModule.kt index 71c5f4854..211d0bdcf 100644 --- a/app/src/main/java/fr/outadoc/justchatting/di/ChatModule.kt +++ b/app/src/main/java/fr/outadoc/justchatting/di/ChatModule.kt @@ -1,7 +1,5 @@ package fr.outadoc.justchatting.di -import android.content.Context -import android.content.pm.PackageManager import fr.outadoc.justchatting.BuildConfig import fr.outadoc.justchatting.component.chatapi.common.handler.ChatCommandHandlerFactoriesProvider import fr.outadoc.justchatting.component.chatapi.common.pubsub.PubSubPluginsProvider @@ -34,13 +32,13 @@ import fr.outadoc.justchatting.feature.chat.data.emotes.GlobalTwitchEmotesSource import fr.outadoc.justchatting.feature.chat.domain.AggregateChatEventHandler import fr.outadoc.justchatting.feature.chat.domain.ChatRepository import fr.outadoc.justchatting.feature.chat.domain.DefaultChatRepository +import fr.outadoc.justchatting.feature.chat.presentation.ChatNotifier import fr.outadoc.justchatting.feature.chat.presentation.ChatViewModel import fr.outadoc.justchatting.feature.chat.presentation.CreateShortcutForChannelUseCase import fr.outadoc.justchatting.feature.chat.presentation.FilterAutocompleteItemsUseCase import fr.outadoc.justchatting.feature.chat.presentation.StreamAndUserInfoViewModel import fr.outadoc.justchatting.feature.chat.presentation.mobile.DefaultChatNotifier import fr.outadoc.justchatting.feature.chat.presentation.mobile.MobileCreateShortcutForChannelUseCase -import fr.outadoc.justchatting.feature.chat.presentation.mobile.NoOpChatNotifier import fr.outadoc.justchatting.feature.pronouns.data.AlejoPronounsApi import fr.outadoc.justchatting.feature.pronouns.domain.DefaultPronounsRepository import fr.outadoc.justchatting.feature.pronouns.domain.PronounsRepository @@ -52,13 +50,7 @@ val chatModule = module { viewModel { ChatViewModel(get(), get(), get(), get(), get(), get(), get(), get(), get()) } viewModel { StreamAndUserInfoViewModel(get()) } - single { - if (get().packageManager.hasSystemFeature(PackageManager.FEATURE_PC)) { - NoOpChatNotifier() - } else { - DefaultChatNotifier(get()) - } - } + single { DefaultChatNotifier(get()) } single { FilterAutocompleteItemsUseCase() } single { MobileCreateShortcutForChannelUseCase(get()) } diff --git a/feature-chat-presentation-mobile/src/main/java/fr/outadoc/justchatting/feature/chat/presentation/mobile/NoOpChatNotifier.kt b/feature-chat-presentation-mobile/src/main/java/fr/outadoc/justchatting/feature/chat/presentation/mobile/NoOpChatNotifier.kt deleted file mode 100644 index 50a5b9617..000000000 --- a/feature-chat-presentation-mobile/src/main/java/fr/outadoc/justchatting/feature/chat/presentation/mobile/NoOpChatNotifier.kt +++ /dev/null @@ -1,14 +0,0 @@ -package fr.outadoc.justchatting.feature.chat.presentation.mobile - -import android.content.Context -import fr.outadoc.justchatting.component.chatapi.domain.model.User -import fr.outadoc.justchatting.feature.chat.presentation.ChatNotifier - -class NoOpChatNotifier : ChatNotifier { - - override val areNotificationsEnabled: Boolean = false - - override fun notify(context: Context, user: User) {} - - override fun dismissNotification(context: Context, channelId: String) {} -}