From 200bf0d9918b7f643a100aea107cfcdbf0c39c60 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 16 Apr 2024 13:14:06 +0930 Subject: [PATCH] Disable swipe to reply on open group invites --- .../securesms/conversation/v2/messages/VisibleMessageView.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt index a59a102d1c..c441f1e23e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt @@ -65,6 +65,7 @@ private const val TAG = "VisibleMessageView" @AndroidEntryPoint class VisibleMessageView : LinearLayout { + private var replyDisabled: Boolean = false @Inject lateinit var threadDb: ThreadDatabase @Inject lateinit var lokiThreadDb: LokiThreadDatabase @Inject lateinit var lokiApiDb: LokiAPIDatabase @@ -135,6 +136,7 @@ class VisibleMessageView : LinearLayout { onAttachmentNeedsDownload: (Long, Long) -> Unit, lastSentMessageId: Long ) { + replyDisabled = message.isOpenGroupInvitation val threadID = message.threadId val thread = threadDb.getRecipientForThreadId(threadID) ?: return val isGroupThread = thread.isGroupRecipient @@ -409,6 +411,7 @@ class VisibleMessageView : LinearLayout { } else { longPressCallback?.let { gestureHandler.removeCallbacks(it) } } + if (replyDisabled) return if (translationX > 0) { return } // Only allow swipes to the left // The idea here is to asymptotically approach a maximum drag distance val damping = 50.0f