Disable member label button for users without permission to edit.

This commit is contained in:
jeffrey-signal
2026-02-25 17:44:01 -05:00
committed by Cody Henthorne
parent 0b2d3edcce
commit 2c747daa50
2 changed files with 7 additions and 1 deletions

View File

@@ -853,13 +853,17 @@ class ConversationSettingsFragment :
)
if (RemoteConfig.sendMemberLabels) {
val canSetMemberLabel = groupState.canSetOwnMemberLabel && !state.isDeprecatedOrUnregistered
clickPref(
title = DSLSettingsText.from(R.string.ConversationSettingsFragment__group_member_label),
icon = DSLSettingsIcon.from(R.drawable.symbol_tag_24),
isEnabled = !state.isDeprecatedOrUnregistered,
isEnabled = canSetMemberLabel,
onClick = {
val action = ConversationSettingsFragmentDirections.actionConversationSettingsFragmentToMemberLabelFragment(groupState.groupId)
navController.safeNavigate(action)
},
onDisabledClicked = {
Snackbar.make(requireView(), R.string.ConversationSettingsFragment__only_admins_can_add_member_labels, Snackbar.LENGTH_SHORT).show()
}
)
}

View File

@@ -5986,6 +5986,8 @@
<string name="ConversationSettingsFragment__group_link">Group link</string>
<!-- Label for button that opens the group member label permissions screen. -->
<string name="ConversationSettingsFragment__group_member_label">Member Label</string>
<!-- Snackbar shown when non-admin taps the member label button -->
<string name="ConversationSettingsFragment__only_admins_can_add_member_labels">Only admins can add member labels in this group.</string>
<!-- Option in conversation settings to add a user as a contact -->
<string name="ConversationSettingsFragment__add_as_a_contact">Add as a contact</string>
<string name="ConversationSettingsFragment__unmute">Unmute</string>