mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Disable swipe to reply on open group invites
This commit is contained in:
parent
9d0fe7581c
commit
200bf0d991
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user