Skip to content

Commit

Permalink
Hide setting entry point to manage 3Pid if homeserver capability `m.3…
Browse files Browse the repository at this point in the history
…pid_changes` is set to `false`.
  • Loading branch information
bmarty committed Aug 21, 2023
1 parent 9aeb3b7 commit 39a7831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/8615.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use 3PID capability to show / hide email UI in settings
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class VectorSettingsGeneralFragment :
private val mPasswordPreference by lazy {
findPreference<VectorPreference>(VectorPreferences.SETTINGS_CHANGE_PASSWORD_PREFERENCE_KEY)!!
}
private val mManage3pidsPreference by lazy {
findPreference<VectorPreference>(VectorPreferences.SETTINGS_EMAILS_AND_PHONE_NUMBERS_PREFERENCE_KEY)!!
}
private val mIdentityServerPreference by lazy {
findPreference<VectorPreference>(VectorPreferences.SETTINGS_IDENTITY_SERVER_PREFERENCE_KEY)!!
}
Expand Down Expand Up @@ -197,6 +200,10 @@ class VectorSettingsGeneralFragment :
mPasswordPreference.isVisible = false
}

// Manage 3Pid
// Hide the preference if 3pids can not be updated
mManage3pidsPreference.isVisible = homeServerCapabilities.canChange3pid

val openDiscoveryScreenPreferenceClickListener = Preference.OnPreferenceClickListener {
(requireActivity() as VectorSettingsActivity).navigateTo(
DiscoverySettingsFragment::class.java,
Expand Down

0 comments on commit 39a7831

Please sign in to comment.