Added some defensive coding to help prevent incorrect message statuses

This commit is contained in:
Morgan Pretty 2023-01-23 12:42:10 +11:00
parent f4fdfd7410
commit a6f09c6fef

View File

@ -207,10 +207,18 @@ class VisibleMessageView : LinearLayout {
}
if (message.isOutgoing) {
val lastMessageID = mmsSmsDb.getLastMessageID(message.threadId)
binding.messageStatusTextView.isVisible =
!message.isSent || message.id == lastMessageID
binding.messageStatusImageView.isVisible =
!message.isSent || message.id == lastMessageID
binding.messageStatusTextView.isVisible = (
textId != null && (
!message.isSent ||
message.id == lastMessageID
)
)
binding.messageStatusImageView.isVisible = (
iconID != null && (
!message.isSent ||
message.id == lastMessageID
)
)
} else {
binding.messageStatusTextView.isVisible = false
binding.messageStatusImageView.isVisible = false