mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-25 05:27:42 +00:00
Prevent various operations on blocked users from conversation.
Fix #10973 Closes #11979
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -1002,6 +1002,10 @@ public class ConversationParentFragment extends Fragment
|
||||
|
||||
inflater.inflate(R.menu.conversation, menu);
|
||||
|
||||
if (isInMessageRequest() && !recipient.get().isBlocked()) {
|
||||
hideMenuItem(menu, R.id.menu_conversation_settings);
|
||||
}
|
||||
|
||||
if (isSingleConversation() && !isSecureText && !recipient.get().isReleaseNotes()) {
|
||||
inflater.inflate(R.menu.conversation_insecure, menu);
|
||||
}
|
||||
@@ -1309,7 +1313,7 @@ public class ConversationParentFragment extends Fragment
|
||||
return;
|
||||
}
|
||||
|
||||
if (isInMessageRequest()) return;
|
||||
if (isInMessageRequest() && !recipient.get().isBlocked()) return;
|
||||
|
||||
Intent intent = ConversationSettingsActivity.forRecipient(requireContext(), recipient.getId());
|
||||
Bundle bundle = ConversationSettingsActivity.createTransitionBundle(requireActivity(), titleView.findViewById(R.id.contact_photo_image), toolbar);
|
||||
|
||||
Reference in New Issue
Block a user