Skip to content

Commit

Permalink
Remove useless feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Renaud committed Aug 23, 2022
1 parent a46dc16 commit f93b489
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
6 changes: 0 additions & 6 deletions vector-config/src/main/java/im/vector/app/config/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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()))
}

Expand All @@ -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))
}

Expand Down

0 comments on commit f93b489

Please sign in to comment.