diff --git a/changelog.d/8619.misc b/changelog.d/8619.misc new file mode 100644 index 00000000000..73e24e1c557 --- /dev/null +++ b/changelog.d/8619.misc @@ -0,0 +1 @@ +Hide account deactivation UI for account managed externally. diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt index ac34764f5fe..2aaf8316551 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt @@ -45,6 +45,7 @@ import im.vector.app.core.intent.getFilenameFromUri import im.vector.app.core.platform.SimpleTextWatcher import im.vector.app.core.preference.UserAvatarPreference import im.vector.app.core.preference.VectorPreference +import im.vector.app.core.preference.VectorPreferenceCategory import im.vector.app.core.preference.VectorSwitchPreference import im.vector.app.core.utils.TextUtils import im.vector.app.core.utils.getSizeOfFiles @@ -110,6 +111,9 @@ class VectorSettingsGeneralFragment : private val mExternalAccountManagementPreference by lazy { findPreference(VectorPreferences.SETTINGS_EXTERNAL_ACCOUNT_MANAGEMENT_KEY)!! } + private val mDeactivateAccountCategory by lazy { + findPreference("SETTINGS_DEACTIVATE_ACCOUNT_CATEGORY_KEY")!! + } // Local contacts private val mContactSettingsCategory by lazy { @@ -322,6 +326,8 @@ class VectorSettingsGeneralFragment : false } + // Account deactivation is visible only if account is not managed by an external URL. + mDeactivateAccountCategory.isVisible = homeServerCapabilities.delegatedOidcAuthEnabled.not() } private suspend fun getCacheSize(): Long = withContext(Dispatchers.IO) { diff --git a/vector/src/main/res/xml/vector_settings_general.xml b/vector/src/main/res/xml/vector_settings_general.xml index 8600dbc1bee..90c75f0e742 100644 --- a/vector/src/main/res/xml/vector_settings_general.xml +++ b/vector/src/main/res/xml/vector_settings_general.xml @@ -113,7 +113,9 @@ - +