mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-28 20:54:38 +01: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
|
enabled = it.canEditGroupAttributes && !state.recipient.isBlocked
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!state.recipient.isReleaseNotes) {
|
if (!state.recipient.isReleaseNotes && !state.recipient.isBlocked) {
|
||||||
clickPref(
|
clickPref(
|
||||||
title = DSLSettingsText.from(R.string.ConversationSettingsFragment__disappearing_messages),
|
title = DSLSettingsText.from(R.string.ConversationSettingsFragment__disappearing_messages),
|
||||||
summary = summary,
|
summary = summary,
|
||||||
@@ -557,15 +557,17 @@ class ConversationSettingsFragment : DSLSettingsFragment(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
customPref(
|
if (!state.recipient.isBlocked) {
|
||||||
LargeIconClickPreference.Model(
|
customPref(
|
||||||
title = DSLSettingsText.from(R.string.ConversationSettingsFragment__add_to_a_group),
|
LargeIconClickPreference.Model(
|
||||||
icon = DSLSettingsIcon.from(R.drawable.add_to_a_group, NO_TINT),
|
title = DSLSettingsText.from(R.string.ConversationSettingsFragment__add_to_a_group),
|
||||||
onClick = {
|
icon = DSLSettingsIcon.from(R.drawable.add_to_a_group, NO_TINT),
|
||||||
viewModel.onAddToGroup()
|
onClick = {
|
||||||
}
|
viewModel.onAddToGroup()
|
||||||
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
|
|
||||||
for (group in recipientSettingsState.groupsInCommon) {
|
for (group in recipientSettingsState.groupsInCommon) {
|
||||||
customPref(
|
customPref(
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ sealed class ConversationSettingsViewModel(
|
|||||||
canModifyBlockedState = !recipient.isSelf && RecipientUtil.isBlockable(recipient),
|
canModifyBlockedState = !recipient.isSelf && RecipientUtil.isBlockable(recipient),
|
||||||
specificSettingsState = state.requireRecipientSettingsState().copy(
|
specificSettingsState = state.requireRecipientSettingsState().copy(
|
||||||
contactLinkState = when {
|
contactLinkState = when {
|
||||||
recipient.isSelf || recipient.isReleaseNotes -> ContactLinkState.NONE
|
recipient.isSelf || recipient.isReleaseNotes || recipient.isBlocked -> ContactLinkState.NONE
|
||||||
recipient.isSystemContact -> ContactLinkState.OPEN
|
recipient.isSystemContact -> ContactLinkState.OPEN
|
||||||
else -> ContactLinkState.ADD
|
else -> ContactLinkState.ADD
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1002,6 +1002,10 @@ public class ConversationParentFragment extends Fragment
|
|||||||
|
|
||||||
inflater.inflate(R.menu.conversation, menu);
|
inflater.inflate(R.menu.conversation, menu);
|
||||||
|
|
||||||
|
if (isInMessageRequest() && !recipient.get().isBlocked()) {
|
||||||
|
hideMenuItem(menu, R.id.menu_conversation_settings);
|
||||||
|
}
|
||||||
|
|
||||||
if (isSingleConversation() && !isSecureText && !recipient.get().isReleaseNotes()) {
|
if (isSingleConversation() && !isSecureText && !recipient.get().isReleaseNotes()) {
|
||||||
inflater.inflate(R.menu.conversation_insecure, menu);
|
inflater.inflate(R.menu.conversation_insecure, menu);
|
||||||
}
|
}
|
||||||
@@ -1309,7 +1313,7 @@ public class ConversationParentFragment extends Fragment
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInMessageRequest()) return;
|
if (isInMessageRequest() && !recipient.get().isBlocked()) return;
|
||||||
|
|
||||||
Intent intent = ConversationSettingsActivity.forRecipient(requireContext(), recipient.getId());
|
Intent intent = ConversationSettingsActivity.forRecipient(requireContext(), recipient.getId());
|
||||||
Bundle bundle = ConversationSettingsActivity.createTransitionBundle(requireActivity(), titleView.findViewById(R.id.contact_photo_image), toolbar);
|
Bundle bundle = ConversationSettingsActivity.createTransitionBundle(requireActivity(), titleView.findViewById(R.id.contact_photo_image), toolbar);
|
||||||
|
|||||||
Reference in New Issue
Block a user