Fix error message interaction on text-only bubbles.
This commit is contained in:
parent
3439861f74
commit
f2a7824168
1 changed files with 23 additions and 4 deletions
|
@ -136,10 +136,7 @@ open class V2ConversationItemTextOnlyViewHolder<Model : MappingModel<Model>>(
|
|||
)
|
||||
}
|
||||
|
||||
binding.root.setOnClickListener {
|
||||
conversationContext.clickListener.onItemClick(getMultiselectPartForLatestTouch())
|
||||
}
|
||||
|
||||
binding.root.setOnClickListener { onBubbleClicked() }
|
||||
binding.root.setOnLongClickListener {
|
||||
conversationContext.clickListener.onItemLongClick(binding.root, getMultiselectPartForLatestTouch())
|
||||
|
||||
|
@ -710,6 +707,28 @@ open class V2ConversationItemTextOnlyViewHolder<Model : MappingModel<Model>>(
|
|||
}
|
||||
}
|
||||
|
||||
private fun onBubbleClicked() {
|
||||
val messageRecord = conversationMessage.messageRecord
|
||||
|
||||
when {
|
||||
conversationContext.selectedItems.isNotEmpty() -> {
|
||||
conversationContext.clickListener.onItemClick(getMultiselectPartForLatestTouch())
|
||||
}
|
||||
messageRecord.isFailed -> {
|
||||
conversationContext.clickListener.onMessageWithErrorClicked(messageRecord)
|
||||
}
|
||||
messageRecord.isRateLimited && SignalStore.rateLimit().needsRecaptcha() -> {
|
||||
conversationContext.clickListener.onMessageWithRecaptchaNeededClicked(messageRecord)
|
||||
}
|
||||
messageRecord.isOutgoing && messageRecord.isIdentityMismatchFailure -> {
|
||||
conversationContext.clickListener.onIncomingIdentityMismatchClicked(messageRecord.fromRecipient.id)
|
||||
}
|
||||
else -> {
|
||||
conversationContext.clickListener.onItemClick(getMultiselectPartForLatestTouch())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun disallowSwipe(latestDownX: Float, latestDownY: Float): Boolean {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue