From f93b489644a1890b205e6a7715079af6b2c57a65 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Tue, 23 Aug 2022 15:59:00 +0200 Subject: [PATCH] Remove useless feature flags --- .../src/main/java/im/vector/app/config/Config.kt | 6 ------ .../timeline/action/MessageActionsEpoxyController.kt | 4 +--- .../detail/timeline/action/MessageActionsViewModel.kt | 10 +++------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/vector-config/src/main/java/im/vector/app/config/Config.kt b/vector-config/src/main/java/im/vector/app/config/Config.kt index c295f702b2..b8daa6349e 100644 --- a/vector-config/src/main/java/im/vector/app/config/Config.kt +++ b/vector-config/src/main/java/im/vector/app/config/Config.kt @@ -28,12 +28,6 @@ object Config { // Tchap: Hide voice message recorder button const val SHOW_VOICE_RECORDER = false - // Tchap: Enable add messages reaction - const val SHOW_ADD_MESSAGE_REACTION = true - - // Tchap: Enable editing messages - const val SHOW_EDIT_MESSAGE = true - /** * Flag to allow external UnifiedPush distributors to be chosen by the user. * diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt index ee3ef02b48..d918703f95 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt @@ -19,7 +19,6 @@ import com.airbnb.epoxy.TypedEpoxyController import com.airbnb.mvrx.Success import im.vector.app.EmojiCompatFontProvider import im.vector.app.R -import im.vector.app.config.Config import im.vector.app.core.date.DateFormatKind import im.vector.app.core.date.VectorDateFormatter import im.vector.app.core.epoxy.bottomSheetDividerItem @@ -150,8 +149,7 @@ class MessageActionsEpoxyController @Inject constructor( } // Quick reactions - // Tchap: feature flag - if (state.canReact() && state.quickStates is Success && Config.SHOW_ADD_MESSAGE_REACTION) { + if (state.canReact() && state.quickStates is Success) { // Separator bottomSheetDividerItem { id("reaction_separator") diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt index 9b57bcee74..adbdff7669 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt @@ -21,7 +21,6 @@ import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import im.vector.app.R -import im.vector.app.config.Config import im.vector.app.core.di.MavericksAssistedViewModelFactory import im.vector.app.core.di.hiltMavericksViewModelFactory import im.vector.app.core.error.ErrorFormatter @@ -295,8 +294,7 @@ class MessageActionsViewModel @AssistedInject constructor( add(EventSharedAction.Resend(eventId)) } add(EventSharedAction.Remove(eventId)) - // Tchap: Disable editing messages - if (canEdit(timelineEvent, session.myUserId, actionPermissions) && Config.SHOW_EDIT_MESSAGE) { + if (canEdit(timelineEvent, session.myUserId, actionPermissions)) { add(EventSharedAction.Edit(eventId, timelineEvent.root.getClearType())) } if (canCopy(msgType)) { @@ -350,8 +348,7 @@ class MessageActionsViewModel @AssistedInject constructor( if (canEndPoll(timelineEvent, actionPermissions)) { add(EventSharedAction.EndPoll(timelineEvent.eventId)) } - // Tchap: feature flag - if (canEdit(timelineEvent, session.myUserId, actionPermissions) && Config.SHOW_EDIT_MESSAGE) { + if (canEdit(timelineEvent, session.myUserId, actionPermissions)) { add(EventSharedAction.Edit(eventId, timelineEvent.root.getClearType())) } @@ -360,8 +357,7 @@ class MessageActionsViewModel @AssistedInject constructor( add(EventSharedAction.Copy(messageContent!!.body)) } - // Tchap: feature flag - if (timelineEvent.canReact() && actionPermissions.canReact && Config.SHOW_ADD_MESSAGE_REACTION) { + if (timelineEvent.canReact() && actionPermissions.canReact) { add(EventSharedAction.AddReaction(eventId)) }