From 8d8876df5910f3c74d998fe37cd0421d584be56b Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Thu, 13 Feb 2025 14:34:53 +1100 Subject: [PATCH] [SES-3300] - More place to hide message/convo actions based on deprecated state (#942) --- .../securesms/MediaPreviewActivity.java | 16 +++++++++++- .../contacts/ContactSelectionListFragment.kt | 16 +++++++++--- .../contacts/ContactSelectionListLoader.kt | 14 ++++++++-- .../conversation/v2/ConversationActivityV2.kt | 22 +++++++++++----- .../v2/ConversationReactionOverlay.kt | 4 +-- .../conversation/v2/ConversationViewModel.kt | 16 ++++++++++++ .../conversation/v2/MessageDetailActivity.kt | 20 +++++++------- .../v2/MessageDetailsViewModel.kt | 13 ++++++++-- .../menus/ConversationActionModeCallback.kt | 26 ++++++++++++------- .../v2/menus/ConversationMenuHelper.kt | 2 +- .../home/ConversationOptionsBottomSheet.kt | 2 +- .../reactions/ReactionRecipientsAdapter.java | 12 ++++++--- .../reactions/ReactionViewPagerAdapter.java | 11 +++++--- .../reactions/ReactionsDialogFragment.java | 8 +++--- .../groups/LegacyGroupDeprecationManager.kt | 2 ++ 15 files changed, 136 insertions(+), 48 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/MediaPreviewActivity.java b/app/src/main/java/org/thoughtcrime/securesms/MediaPreviewActivity.java index c714aa0eea..731f3ec75e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/MediaPreviewActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/MediaPreviewActivity.java @@ -61,8 +61,12 @@ import com.squareup.phrase.Phrase; import java.io.IOException; import java.util.Locale; import java.util.WeakHashMap; + +import dagger.hilt.android.AndroidEntryPoint; import kotlin.Unit; import network.loki.messenger.R; + +import org.session.libsession.messaging.groups.LegacyGroupDeprecationManager; import org.session.libsession.messaging.messages.control.DataExtractionNotification; import org.session.libsession.messaging.sending_receiving.MessageSender; import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAttachment; @@ -87,9 +91,12 @@ import org.thoughtcrime.securesms.util.DateUtils; import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment; import org.thoughtcrime.securesms.util.SaveAttachmentTask; +import javax.inject.Inject; + /** * Activity for displaying media attachments in-app */ +@AndroidEntryPoint public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity implements RecipientModifiedListener, LoaderManager.LoaderCallbacks>, MediaRailAdapter.RailItemListener @@ -124,6 +131,9 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im private MediaPreviewViewModel viewModel; private ViewPagerListener viewPagerListener; + @Inject + LegacyGroupDeprecationManager deprecationManager; + private int restartItem = -1; private boolean isFullscreen = false; @@ -476,7 +486,11 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im MenuInflater inflater = this.getMenuInflater(); inflater.inflate(R.menu.media_preview, menu); - if (!isMediaInDb()) { + final boolean isDeprecatedLegacyGroup = conversationRecipient != null && + conversationRecipient.isLegacyGroupRecipient() && + deprecationManager.getDeprecationState().getValue() == LegacyGroupDeprecationManager.DeprecationState.DEPRECATED; + + if (!isMediaInDb() || isDeprecatedLegacyGroup) { menu.findItem(R.id.media_preview__overview).setVisible(false); menu.findItem(R.id.delete).setVisible(false); } diff --git a/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListFragment.kt index 704d170e93..995d194266 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListFragment.kt @@ -12,12 +12,19 @@ import network.loki.messenger.databinding.ContactSelectionListFragmentBinding import org.session.libsession.utilities.recipients.Recipient import org.session.libsignal.utilities.Log import com.bumptech.glide.Glide +import dagger.hilt.android.AndroidEntryPoint +import org.session.libsession.messaging.groups.LegacyGroupDeprecationManager +import javax.inject.Inject +@AndroidEntryPoint class ContactSelectionListFragment : Fragment(), LoaderManager.LoaderCallbacks>, ContactClickListener { private lateinit var binding: ContactSelectionListFragmentBinding private var cursorFilter: String? = null var onContactSelectedListener: OnContactSelectedListener? = null + @Inject + lateinit var deprecationManager: LegacyGroupDeprecationManager + private val multiSelect: Boolean by lazy { requireActivity().intent.getBooleanExtra(MULTI_SELECT, false) } @@ -71,9 +78,12 @@ class ContactSelectionListFragment : Fragment(), LoaderManager.LoaderCallbacks> { - return ContactSelectionListLoader(requireActivity(), - requireActivity().intent.getIntExtra(DISPLAY_MODE, ContactsCursorLoader.DisplayMode.FLAG_ALL), - cursorFilter) + return ContactSelectionListLoader( + context = requireActivity(), + mode = requireActivity().intent.getIntExtra(DISPLAY_MODE, ContactsCursorLoader.DisplayMode.FLAG_ALL), + filter = cursorFilter, + deprecationManager = deprecationManager + ) } override fun onLoadFinished(loader: Loader>, items: List) { diff --git a/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListLoader.kt b/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListLoader.kt index 7bfb8dd54c..9164d53e7c 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListLoader.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListLoader.kt @@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.contacts import android.content.Context import network.loki.messenger.R +import org.session.libsession.messaging.groups.LegacyGroupDeprecationManager import org.thoughtcrime.securesms.util.ContactUtilities import org.session.libsession.utilities.recipients.Recipient import org.thoughtcrime.securesms.util.AsyncLoader @@ -11,7 +12,12 @@ sealed class ContactSelectionListItem { class Contact(val recipient: Recipient) : ContactSelectionListItem() } -class ContactSelectionListLoader(context: Context, val mode: Int, val filter: String?) : AsyncLoader>(context) { +class ContactSelectionListLoader( + context: Context, + val mode: Int, + val filter: String?, + private val deprecationManager: LegacyGroupDeprecationManager, +) : AsyncLoader>(context) { object DisplayMode { const val FLAG_CONTACTS = 1 @@ -51,7 +57,11 @@ class ContactSelectionListLoader(context: Context, val mode: Int, val filter: St } private fun getGroups(contacts: List): List { - return getItems(contacts, context.getString(R.string.conversationsGroups)) { it.address.isGroup } + return getItems(contacts, context.getString(R.string.conversationsGroups)) { + val isDeprecatedLegacyGroup = it.isLegacyGroupRecipient && + deprecationManager.isDeprecated + it.address.isGroup && !isDeprecatedLegacyGroup + } } private fun getCommunities(contacts: List): List { diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index 9fc48dbe47..d1fad5b238 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -985,7 +985,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe override fun onPrepareOptionsMenu(menu: Menu): Boolean { val recipient = viewModel.recipient ?: return false - if (!viewModel.isMessageRequestThread) { + if (viewModel.showOptionsMenu) { ConversationMenuHelper.onPrepareOptionsMenu( menu = menu, inflater = menuInflater, @@ -1396,7 +1396,12 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe private fun onDeselect(message: MessageRecord, position: Int, actionMode: ActionMode) { adapter.toggleSelection(message, position) - val actionModeCallback = ConversationActionModeCallback(adapter, viewModel.threadId, this) + val actionModeCallback = ConversationActionModeCallback( + adapter = adapter, + threadID = viewModel.threadId, + context = this, + deprecationManager = viewModel.legacyGroupDeprecationManager + ) actionModeCallback.delegate = this actionModeCallback.updateActionModeMenu(actionMode.menu) if (adapter.selectedItems.isEmpty()) { @@ -1415,7 +1420,12 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe // `position` is the adapter position; not the visual position private fun selectMessage(message: MessageRecord, position: Int) { val actionMode = this.actionMode - val actionModeCallback = ConversationActionModeCallback(adapter, viewModel.threadId, this) + val actionModeCallback = ConversationActionModeCallback( + adapter = adapter, + threadID = viewModel.threadId, + context = this, + deprecationManager = viewModel.legacyGroupDeprecationManager + ) actionModeCallback.delegate = this searchViewItem?.collapseActionView() if (actionMode == null) { // Nothing should be selected if this is the case @@ -1774,9 +1784,9 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe } else { smsDb.getMessageRecord(messageId.id) } - if (userWasSender) { + if (userWasSender && viewModel.canRemoveReaction) { sendEmojiRemoval(emoji, message) - } else { + } else if (!userWasSender && viewModel.canReactToMessages) { sendEmojiReaction(emoji, message) } } @@ -1787,7 +1797,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe val userPublicKey = textSecurePreferences.getLocalNumber() ?: return@let false OpenGroupManager.isUserModerator(this, openGroup.id, userPublicKey, viewModel.blindedPublicKey) } ?: false - val fragment = ReactionsDialogFragment.create(messageId, isUserModerator, emoji) + val fragment = ReactionsDialogFragment.create(messageId, isUserModerator, emoji, viewModel.canRemoveReaction) fragment.show(supportFragmentManager, null) } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationReactionOverlay.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationReactionOverlay.kt index 3903e5a555..6fa639d956 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationReactionOverlay.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationReactionOverlay.kt @@ -273,7 +273,7 @@ class ConversationReactionOverlay : FrameLayout { val isDeprecatedLegacyGroup = recipient?.isLegacyGroupRecipient == true && - deprecationManager.deprecationState.value == LegacyGroupDeprecationManager.DeprecationState.DEPRECATED + deprecationManager.isDeprecated foregroundView.isVisible = !isDeprecatedLegacyGroup backgroundView.isVisible = !isDeprecatedLegacyGroup foregroundView.x = scrubberX @@ -567,7 +567,7 @@ class ConversationReactionOverlay : FrameLayout { val isDeprecatedLegacyGroup = recipient.isLegacyGroupRecipient && - deprecationManager.deprecationState.value == LegacyGroupDeprecationManager.DeprecationState.DEPRECATED + deprecationManager.isDeprecated // Reply val canWrite = openGroup == null || openGroup.canWrite diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt index 1eecd6ce59..fa081dabf6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt @@ -196,9 +196,25 @@ class ConversationViewModel( return !recipient.isLocalNumber && !recipient.isLegacyGroupRecipient && !recipient.isCommunityRecipient && !recipient.isApproved } + val showOptionsMenu: Boolean + get() { + if (isMessageRequestThread) { + return false + } + + return !isDeprecatedLegacyGroup + } + + private val isDeprecatedLegacyGroup: Boolean + get() = recipient?.isLegacyGroupRecipient == true && legacyGroupDeprecationManager.isDeprecated + val canReactToMessages: Boolean // allow reactions if the open group is null (normal conversations) or the open group's capabilities include reactions get() = (openGroup == null || OpenGroupApi.Capability.REACTIONS.name.lowercase() in serverCapabilities) + && !isDeprecatedLegacyGroup + + val canRemoveReaction: Boolean + get() = canReactToMessages val legacyGroupBanner: StateFlow = combine( legacyGroupDeprecationManager.deprecationState, diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt index 038210f8ff..e44a11135d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt @@ -135,7 +135,7 @@ class MessageDetailActivity : PassphraseRequiredActionBarActivity() { onReply = if (state.canReply) { { setResultAndFinish(ON_REPLY) } } else null, onResend = state.error?.let { { setResultAndFinish(ON_RESEND) } }, onSave = if(canSave) { { setResultAndFinish(ON_SAVE) } } else null, - onDelete = { setResultAndFinish(ON_DELETE) }, + onDelete = if (state.canDelete) { { setResultAndFinish(ON_DELETE) } } else null, onCopy = { setResultAndFinish(ON_COPY) }, onClickImage = { viewModel.onClickImage(it) }, onAttachmentNeedsDownload = viewModel::onAttachmentNeedsDownload, @@ -158,7 +158,7 @@ fun MessageDetails( onReply: (() -> Unit)? = null, onResend: (() -> Unit)? = null, onSave: (() -> Unit)? = null, - onDelete: () -> Unit = {}, + onDelete: (() -> Unit)? = null, onCopy: () -> Unit = {}, onClickImage: (Int) -> Unit = {}, onAttachmentNeedsDownload: (DatabaseAttachment) -> Unit = { _ -> } @@ -242,7 +242,7 @@ fun CellButtons( onReply: (() -> Unit)? = null, onResend: (() -> Unit)? = null, onSave: (() -> Unit)? = null, - onDelete: () -> Unit, + onDelete: (() -> Unit)? = null, onCopy: () -> Unit ) { Cell(modifier = Modifier.padding(horizontal = LocalDimensions.current.spacing)) { @@ -281,12 +281,14 @@ fun CellButtons( Divider() } - LargeItemButton( - R.string.delete, - R.drawable.ic_delete, - colors = dangerButtonColors(), - onClick = onDelete - ) + onDelete?.let { + LargeItemButton( + R.string.delete, + R.drawable.ic_delete, + colors = dangerButtonColors(), + onClick = it + ) + } } } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailsViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailsViewModel.kt index fcaca71c6a..caaff7a66a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailsViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailsViewModel.kt @@ -13,6 +13,7 @@ import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch import network.loki.messenger.R +import org.session.libsession.messaging.groups.LegacyGroupDeprecationManager import org.session.libsession.messaging.jobs.AttachmentDownloadJob import org.session.libsession.messaging.jobs.JobQueue import org.session.libsession.messaging.sending_receiving.attachments.AttachmentTransferProgress @@ -42,6 +43,7 @@ class MessageDetailsViewModel @Inject constructor( private val mmsSmsDatabase: MmsSmsDatabase, private val threadDb: ThreadDatabase, private val repository: ConversationRepository, + private val deprecationManager: LegacyGroupDeprecationManager, ) : ViewModel() { private var job: Job? = null @@ -75,6 +77,10 @@ class MessageDetailsViewModel @Inject constructor( state.value = record.run { val slides = mmsRecord?.slideDeck?.slides ?: emptyList() + val recipient = threadDb.getRecipientForThreadId(threadId)!! + val isDeprecatedLegacyGroup = recipient.isLegacyGroupRecipient && + deprecationManager.isDeprecated + MessageDetailsState( attachments = slides.map(::Attachment), record = record, @@ -83,7 +89,8 @@ class MessageDetailsViewModel @Inject constructor( error = lokiMessageDatabase.getErrorMessage(id)?.let { TitledText(R.string.theError, it) }, senderInfo = individualRecipient.run { name?.let { TitledText(it, address.serialize()) } }, sender = individualRecipient, - thread = threadDb.getRecipientForThreadId(threadId)!!, + thread = recipient, + readOnly = isDeprecatedLegacyGroup, ) } } @@ -156,9 +163,11 @@ data class MessageDetailsState( val senderInfo: TitledText? = null, val sender: Recipient? = null, val thread: Recipient? = null, + val readOnly: Boolean = false, ) { val fromTitle = GetString(R.string.from) - val canReply = record?.isOpenGroupInvitation != true + val canReply: Boolean get() = !readOnly && record?.isOpenGroupInvitation != true + val canDelete: Boolean get() = !readOnly } data class Attachment( diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationActionModeCallback.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationActionModeCallback.kt index a4c2685dc3..e6d9a64b86 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationActionModeCallback.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationActionModeCallback.kt @@ -6,6 +6,7 @@ import android.view.Menu import android.view.MenuItem import network.loki.messenger.R import org.session.libsession.messaging.MessagingModuleConfiguration +import org.session.libsession.messaging.groups.LegacyGroupDeprecationManager import org.session.libsession.messaging.utilities.SodiumUtilities import org.session.libsession.utilities.TextSecurePreferences import org.session.libsignal.utilities.IdPrefix @@ -16,8 +17,12 @@ import org.thoughtcrime.securesms.database.model.MessageRecord import org.thoughtcrime.securesms.dependencies.DatabaseComponent import org.thoughtcrime.securesms.groups.OpenGroupManager -class ConversationActionModeCallback(private val adapter: ConversationAdapter, private val threadID: Long, - private val context: Context) : ActionMode.Callback { +class ConversationActionModeCallback( + private val adapter: ConversationAdapter, + private val threadID: Long, + private val context: Context, + private val deprecationManager: LegacyGroupDeprecationManager, + ) : ActionMode.Callback { var delegate: ConversationActionModeCallbackDelegate? = null override fun onCreateActionMode(mode: ActionMode, menu: Menu): Boolean { @@ -41,6 +46,9 @@ class ConversationActionModeCallback(private val adapter: ConversationAdapter, p val blindedPublicKey = openGroup?.publicKey?.let { SodiumUtilities.blindedKeyPair(it, edKeyPair)?.publicKey?.asBytes } ?.let { AccountId(IdPrefix.BLINDED, it) }?.hexString + val isDeprecatedLegacyGroup = thread.isLegacyGroupRecipient && + deprecationManager.isDeprecated + // Embedded function fun userCanBanSelectedUsers(): Boolean { if (openGroup == null) { return false } @@ -54,28 +62,28 @@ class ConversationActionModeCallback(private val adapter: ConversationAdapter, p // Delete message - menu.findItem(R.id.menu_context_delete_message).isVisible = true // can always delete since delete logic will be handled by the VM + menu.findItem(R.id.menu_context_delete_message).isVisible = !isDeprecatedLegacyGroup // can always delete since delete logic will be handled by the VM // Ban user - menu.findItem(R.id.menu_context_ban_user).isVisible = userCanBanSelectedUsers() + menu.findItem(R.id.menu_context_ban_user).isVisible = userCanBanSelectedUsers() && !isDeprecatedLegacyGroup // Ban and delete all - menu.findItem(R.id.menu_context_ban_and_delete_all).isVisible = userCanBanSelectedUsers() + menu.findItem(R.id.menu_context_ban_and_delete_all).isVisible = userCanBanSelectedUsers() && !isDeprecatedLegacyGroup // Copy message text menu.findItem(R.id.menu_context_copy).isVisible = !containsControlMessage && hasText // Copy Account ID menu.findItem(R.id.menu_context_copy_public_key).isVisible = (thread.isGroupOrCommunityRecipient && !thread.isCommunityRecipient && selectedItems.size == 1 && firstMessage.individualRecipient.address.toString() != userPublicKey) // Message detail - menu.findItem(R.id.menu_message_details).isVisible = selectedItems.size == 1 + menu.findItem(R.id.menu_message_details).isVisible = selectedItems.size == 1 && !isDeprecatedLegacyGroup // Resend - menu.findItem(R.id.menu_context_resend).isVisible = (selectedItems.size == 1 && firstMessage.isFailed) + menu.findItem(R.id.menu_context_resend).isVisible = (selectedItems.size == 1 && firstMessage.isFailed) && !isDeprecatedLegacyGroup // Resync - menu.findItem(R.id.menu_context_resync).isVisible = (selectedItems.size == 1 && firstMessage.isSyncFailed) + menu.findItem(R.id.menu_context_resync).isVisible = (selectedItems.size == 1 && firstMessage.isSyncFailed) && !isDeprecatedLegacyGroup // Save media menu.findItem(R.id.menu_context_save_attachment).isVisible = (selectedItems.size == 1 && firstMessage.isMms && (firstMessage as MediaMmsMessageRecord).containsMediaSlide()) // Reply menu.findItem(R.id.menu_context_reply).isVisible = - (selectedItems.size == 1 && !firstMessage.isPending && !firstMessage.isFailed && !firstMessage.isOpenGroupInvitation) + (!isDeprecatedLegacyGroup && selectedItems.size == 1 && !firstMessage.isPending && !firstMessage.isFailed && !firstMessage.isOpenGroupInvitation) } override fun onPrepareActionMode(mode: ActionMode?, menu: Menu): Boolean { diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt index 8bd3a8f362..fe870694fe 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt @@ -74,7 +74,7 @@ object ConversationMenuHelper { deprecationManager: LegacyGroupDeprecationManager, ) { val isDeprecatedLegacyGroup = thread.isLegacyGroupRecipient && - deprecationManager.deprecationState.value == LegacyGroupDeprecationManager.DeprecationState.DEPRECATED + deprecationManager.isDeprecated // Prepare menu.clear() diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/ConversationOptionsBottomSheet.kt b/app/src/main/java/org/thoughtcrime/securesms/home/ConversationOptionsBottomSheet.kt index b67495e82e..15b503c9e8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/ConversationOptionsBottomSheet.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/ConversationOptionsBottomSheet.kt @@ -84,7 +84,7 @@ class ConversationOptionsBottomSheet(private val parentContext: Context) : Botto } val isDeprecatedLegacyGroup = recipient.isLegacyGroupRecipient && - deprecationManager.deprecationState.value == LegacyGroupDeprecationManager.DeprecationState.DEPRECATED + deprecationManager.isDeprecated binding.copyConversationId.isVisible = !recipient.isGroupOrCommunityRecipient && !recipient.isLocalNumber diff --git a/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionRecipientsAdapter.java b/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionRecipientsAdapter.java index dd9f17281b..a1eace1e29 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionRecipientsAdapter.java +++ b/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionRecipientsAdapter.java @@ -36,9 +36,11 @@ final class ReactionRecipientsAdapter extends RecyclerView.Adapter()); this.callback = callback; + this.canRemove = canRemove; } public void setIsUserModerator(boolean isUserModerator) { @@ -59,7 +62,7 @@ class ReactionViewPagerAdapter extends ListAdapter