Merge pull request #8627 from vector-im/feature/bma/hideAccountDeactivation

Hide deactivate account section in case of account managed externally.
This commit is contained in:
Benoit Marty 2023-09-14 21:53:13 +02:00 committed by GitHub
commit 8c1cc44255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

1
changelog.d/8619.misc Normal file
View File

@ -0,0 +1 @@
Hide account deactivation UI for account managed externally.

View File

@ -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<VectorPreference>(VectorPreferences.SETTINGS_EXTERNAL_ACCOUNT_MANAGEMENT_KEY)!!
}
private val mDeactivateAccountCategory by lazy {
findPreference<VectorPreferenceCategory>("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) {

View File

@ -113,7 +113,9 @@
</im.vector.app.core.preference.VectorPreferenceCategory>
<im.vector.app.core.preference.VectorPreferenceCategory android:title="@string/settings_deactivate_account_section">
<im.vector.app.core.preference.VectorPreferenceCategory
android:key="SETTINGS_DEACTIVATE_ACCOUNT_CATEGORY_KEY"
android:title="@string/settings_deactivate_account_section">
<im.vector.app.core.preference.VectorPreference
android:key="SETTINGS_DEACTIVATE_ACCOUNT_KEY"