mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-09 16:48:54 +01:00
Remove deprecated restricted lab option (#4889)
Remove deprecated restricted lab option
This commit is contained in:
parent
008034895b
commit
bf447afa5a
1
changelog.d/4889.removal
Normal file
1
changelog.d/4889.removal
Normal file
@ -0,0 +1 @@
|
||||
Remove deprecated experimental restricted space lab option
|
@ -31,7 +31,6 @@ import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.features.raw.wellknown.getElementWellknown
|
||||
import im.vector.app.features.raw.wellknown.isE2EByDefault
|
||||
import im.vector.app.features.settings.VectorPreferences
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.MatrixPatterns.getDomain
|
||||
@ -54,8 +53,7 @@ import timber.log.Timber
|
||||
|
||||
class CreateRoomViewModel @AssistedInject constructor(@Assisted private val initialState: CreateRoomViewState,
|
||||
private val session: Session,
|
||||
private val rawService: RawService,
|
||||
vectorPreferences: VectorPreferences
|
||||
private val rawService: RawService
|
||||
) : VectorViewModel<CreateRoomViewState, CreateRoomAction, CreateRoomViewEvents>(initialState) {
|
||||
|
||||
@AssistedFactory
|
||||
@ -70,11 +68,7 @@ class CreateRoomViewModel @AssistedInject constructor(@Assisted private val init
|
||||
initAdminE2eByDefault()
|
||||
|
||||
val restrictedSupport = session.getHomeServerCapabilities().isFeatureSupported(HomeServerCapabilities.ROOM_CAP_RESTRICTED)
|
||||
val createRestricted = when (restrictedSupport) {
|
||||
HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED -> true
|
||||
HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED_UNSTABLE -> vectorPreferences.labsUseExperimentalRestricted()
|
||||
else -> false
|
||||
}
|
||||
val createRestricted = restrictedSupport == HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED
|
||||
|
||||
val defaultJoinRules = if (initialState.parentSpaceId != null && createRestricted) {
|
||||
RoomJoinRules.RESTRICTED
|
||||
|
@ -73,11 +73,7 @@ class RoomSettingsViewModel @AssistedInject constructor(@Assisted initialState:
|
||||
.isFeatureSupported(HomeServerCapabilities.ROOM_CAP_RESTRICTED, room.getRoomVersion())
|
||||
|
||||
val restrictedSupport = homeServerCapabilities.isFeatureSupported(HomeServerCapabilities.ROOM_CAP_RESTRICTED)
|
||||
val couldUpgradeToRestricted = when (restrictedSupport) {
|
||||
HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED -> true
|
||||
HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED_UNSTABLE -> vectorPreferences.labsUseExperimentalRestricted()
|
||||
else -> false
|
||||
}
|
||||
val couldUpgradeToRestricted = restrictedSupport == HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED
|
||||
|
||||
setState {
|
||||
copy(
|
||||
|
@ -109,11 +109,7 @@ class RoomJoinRuleChooseRestrictedViewModel @AssistedInject constructor(
|
||||
}
|
||||
|
||||
val restrictedSupport = homeServerCapabilities.isFeatureSupported(HomeServerCapabilities.ROOM_CAP_RESTRICTED)
|
||||
val couldUpgradeToRestricted = when (restrictedSupport) {
|
||||
HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED -> true
|
||||
HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED_UNSTABLE -> vectorPreferences.labsUseExperimentalRestricted()
|
||||
else -> false
|
||||
}
|
||||
val couldUpgradeToRestricted = restrictedSupport == HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED
|
||||
|
||||
val choices = if (restrictedSupportedByThisVersion || couldUpgradeToRestricted) {
|
||||
listOf(
|
||||
|
@ -150,7 +150,6 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
||||
private const val SETTINGS_ENABLE_SEND_VOICE_FEATURE_PREFERENCE_KEY = "SETTINGS_ENABLE_SEND_VOICE_FEATURE_PREFERENCE_KEY"
|
||||
|
||||
const val SETTINGS_LABS_ALLOW_EXTENDED_LOGS = "SETTINGS_LABS_ALLOW_EXTENDED_LOGS"
|
||||
const val SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE = "SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE"
|
||||
const val SETTINGS_LABS_SPACES_HOME_AS_ORPHAN = "SETTINGS_LABS_SPACES_HOME_AS_ORPHAN"
|
||||
const val SETTINGS_LABS_AUTO_REPORT_UISI = "SETTINGS_LABS_AUTO_REPORT_UISI"
|
||||
const val SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME = "SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME"
|
||||
@ -246,7 +245,6 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
||||
SETTINGS_DEVELOPER_MODE_PREFERENCE_KEY,
|
||||
SETTINGS_LABS_SHOW_HIDDEN_EVENTS_PREFERENCE_KEY,
|
||||
SETTINGS_LABS_ALLOW_EXTENDED_LOGS,
|
||||
// SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE,
|
||||
SETTINGS_DEVELOPER_MODE_FAIL_FAST_PREFERENCE_KEY,
|
||||
|
||||
SETTINGS_USE_RAGE_SHAKE_KEY,
|
||||
@ -967,10 +965,6 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
fun labsUseExperimentalRestricted(): Boolean {
|
||||
return defaultPrefs.getBoolean(SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE, false)
|
||||
}
|
||||
|
||||
private fun labsSpacesOnlyOrphansInHome(): Boolean {
|
||||
return defaultPrefs.getBoolean(SETTINGS_LABS_SPACES_HOME_AS_ORPHAN, false)
|
||||
}
|
||||
|
@ -125,11 +125,7 @@ class CreateSpaceViewModelTask @Inject constructor(
|
||||
val restrictedSupport = homeServerCapabilities
|
||||
.isFeatureSupported(HomeServerCapabilities.ROOM_CAP_RESTRICTED)
|
||||
|
||||
val createRestricted = when (restrictedSupport) {
|
||||
HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED -> true
|
||||
HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED_UNSTABLE -> vectorPreferences.labsUseExperimentalRestricted()
|
||||
else -> false
|
||||
}
|
||||
val createRestricted = restrictedSupport == HomeServerCapabilities.RoomCapabilitySupport.SUPPORTED
|
||||
if (createRestricted) {
|
||||
session.createRoom(CreateRoomParams().apply {
|
||||
this.name = roomName
|
||||
|
@ -3562,11 +3562,11 @@
|
||||
<string name="spaces_beta_welcome_to_spaces_desc">Spaces are a new way to group rooms and people.</string>
|
||||
<string name="you_are_invited">You are invited</string>
|
||||
|
||||
|
||||
<!-- TO BE REMOVED -->
|
||||
<string name="labs_use_restricted_join_rule">Experimental Space - Restricted Room.</string>
|
||||
<!-- TO BE REMOVED -->
|
||||
<string name="labs_use_restricted_join_rule_desc">Warning requires server support and experimental room version</string>
|
||||
|
||||
|
||||
<string name="labs_auto_report_uisi">Auto Report Decryption Errors.</string>
|
||||
<string name="labs_auto_report_uisi_desc">Your system will automatically send logs when an unable to decrypt error occurs</string>
|
||||
|
||||
|
@ -44,12 +44,6 @@
|
||||
android:key="SETTINGS_LABS_UNREAD_NOTIFICATIONS_AS_TAB"
|
||||
android:title="@string/labs_show_unread_notifications_as_tab" />
|
||||
|
||||
<im.vector.app.core.preference.VectorSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE"
|
||||
android:summary="@string/labs_use_restricted_join_rule_desc"
|
||||
android:title="@string/labs_use_restricted_join_rule" />
|
||||
|
||||
<im.vector.app.core.preference.VectorSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="SETTINGS_LABS_ENABLE_LATEX_MATHS"
|
||||
|
Loading…
x
Reference in New Issue
Block a user