Skip to content

Commit 69af25a

Browse files
authored
Merge pull request #9058 from element-hq/bca/hide_manually_verify_behind_flag
Hide the `Manually Verify by Text` option behind devtool flag
2 parents d63fc0b + d26a25a commit 69af25a

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

changelog.d/9058.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hide the "Manually Verify by Text" option behind devtool flag.

vector/src/main/java/im/vector/app/features/settings/devices/DeviceVerificationInfoBottomSheetController.kt

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import im.vector.app.core.ui.list.genericFooterItem
1717
import im.vector.app.core.ui.list.genericItem
1818
import im.vector.app.core.ui.views.toDrawableRes
1919
import im.vector.app.features.crypto.verification.epoxy.bottomSheetVerificationActionItem
20+
import im.vector.app.features.settings.VectorPreferences
2021
import im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence
2122
import im.vector.lib.strings.CommonStrings
2223
import org.matrix.android.sdk.api.extensions.orFalse
@@ -26,7 +27,8 @@ import javax.inject.Inject
2627

2728
class DeviceVerificationInfoBottomSheetController @Inject constructor(
2829
private val stringProvider: StringProvider,
29-
private val colorProvider: ColorProvider
30+
private val colorProvider: ColorProvider,
31+
private val vectorPreferences: VectorPreferences
3032
) :
3133
TypedEpoxyController<DeviceVerificationInfoBottomSheetViewState>() {
3234

@@ -244,17 +246,19 @@ class DeviceVerificationInfoBottomSheetController @Inject constructor(
244246

245247
private fun addVerifyActions(cryptoDeviceInfo: CryptoDeviceInfo) {
246248
val host = this
247-
bottomSheetDividerItem {
248-
id("verifyDiv")
249-
}
250-
bottomSheetVerificationActionItem {
251-
id("verify_text")
252-
title(host.stringProvider.getString(CommonStrings.cross_signing_verify_by_text))
253-
titleColor(host.colorProvider.getColorFromAttribute(com.google.android.material.R.attr.colorPrimary))
254-
iconRes(R.drawable.ic_arrow_right)
255-
iconColor(host.colorProvider.getColorFromAttribute(com.google.android.material.R.attr.colorPrimary))
256-
listener {
257-
host.callback?.onAction(DevicesAction.VerifyMyDeviceManually(cryptoDeviceInfo.deviceId))
249+
if (vectorPreferences.developerMode()) {
250+
bottomSheetDividerItem {
251+
id("verifyDiv")
252+
}
253+
bottomSheetVerificationActionItem {
254+
id("verify_text")
255+
title(host.stringProvider.getString(CommonStrings.cross_signing_verify_by_text))
256+
titleColor(host.colorProvider.getColorFromAttribute(com.google.android.material.R.attr.colorPrimary))
257+
iconRes(R.drawable.ic_arrow_right)
258+
iconColor(host.colorProvider.getColorFromAttribute(com.google.android.material.R.attr.colorPrimary))
259+
listener {
260+
host.callback?.onAction(DevicesAction.VerifyMyDeviceManually(cryptoDeviceInfo.deviceId))
261+
}
258262
}
259263
}
260264
bottomSheetDividerItem {

0 commit comments

Comments
 (0)