Prevent various operations on blocked users from conversation.

Fix #10973
Closes #11979
This commit is contained in:
Sgn-32
2022-03-29 22:33:01 +02:00
committed by Greyson Parrelli
parent f8d459829e
commit f3873c8a7c
3 changed files with 17 additions and 11 deletions

View File

@@ -420,7 +420,7 @@ class ConversationSettingsFragment : DSLSettingsFragment(
enabled = it.canEditGroupAttributes && !state.recipient.isBlocked
}
if (!state.recipient.isReleaseNotes) {
if (!state.recipient.isReleaseNotes && !state.recipient.isBlocked) {
clickPref(
title = DSLSettingsText.from(R.string.ConversationSettingsFragment__disappearing_messages),
summary = summary,
@@ -557,15 +557,17 @@ class ConversationSettingsFragment : DSLSettingsFragment(
)
)
customPref(
LargeIconClickPreference.Model(
title = DSLSettingsText.from(R.string.ConversationSettingsFragment__add_to_a_group),
icon = DSLSettingsIcon.from(R.drawable.add_to_a_group, NO_TINT),
onClick = {
viewModel.onAddToGroup()
}
if (!state.recipient.isBlocked) {
customPref(
LargeIconClickPreference.Model(
title = DSLSettingsText.from(R.string.ConversationSettingsFragment__add_to_a_group),
icon = DSLSettingsIcon.from(R.drawable.add_to_a_group, NO_TINT),
onClick = {
viewModel.onAddToGroup()
}
)
)
)
}
for (group in recipientSettingsState.groupsInCommon) {
customPref(

View File

@@ -152,7 +152,7 @@ sealed class ConversationSettingsViewModel(
canModifyBlockedState = !recipient.isSelf && RecipientUtil.isBlockable(recipient),
specificSettingsState = state.requireRecipientSettingsState().copy(
contactLinkState = when {
recipient.isSelf || recipient.isReleaseNotes -> ContactLinkState.NONE
recipient.isSelf || recipient.isReleaseNotes || recipient.isBlocked -> ContactLinkState.NONE
recipient.isSystemContact -> ContactLinkState.OPEN
else -> ContactLinkState.ADD
}