diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/DeleteOptionsBottomSheet.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/DeleteOptionsBottomSheet.kt index ccf30b55b1..6272a9c224 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/DeleteOptionsBottomSheet.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/DeleteOptionsBottomSheet.kt @@ -4,6 +4,7 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.view.isVisible import com.google.android.material.bottomsheet.BottomSheetDialogFragment import dagger.hilt.android.AndroidEntryPoint import kotlinx.android.synthetic.main.fragment_delete_message_bottom_sheet.* @@ -57,6 +58,7 @@ class DeleteOptionsBottomSheet : BottomSheetDialogFragment(), View.OnClickListen deleteForEveryoneTextView.text = resources.getString(R.string.delete_message_for_me_and_recipient, contact) } + deleteForEveryoneTextView.isVisible = !recipient.isClosedGroupRecipient deleteForMeTextView.setOnClickListener(this) deleteForEveryoneTextView.setOnClickListener(this) cancelTextView.setOnClickListener(this) diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/ReceivedMessageHandler.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/ReceivedMessageHandler.kt index a99c268687..4f94df7cef 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/ReceivedMessageHandler.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/ReceivedMessageHandler.kt @@ -144,7 +144,8 @@ private fun handleConfigurationMessage(message: ConfigurationMessage) { } fun MessageReceiver.handleUnsendRequest(message: UnsendRequest) { - if (message.sender != message.author) { return } + val userPublicKey = MessagingModuleConfiguration.shared.storage.getUserPublicKey() + if (message.sender != message.author && (message.sender != userPublicKey && userPublicKey != null)) { return } val context = MessagingModuleConfiguration.shared.context val storage = MessagingModuleConfiguration.shared.storage val messageDataProvider = MessagingModuleConfiguration.shared.messageDataProvider