only show new message notice when there are messages from other participants

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-05-15 15:50:40 +02:00
parent 5810d070fa
commit ac39e73782
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -3759,7 +3759,13 @@ class ChatActivity :
}
private fun processMessagesFromTheFuture(chatMessageList: List<ChatMessage>) {
val insertNewMessagesNotice = (adapter?.itemCount ?: 0) > 0 && chatMessageList.isNotEmpty()
val newMessagesAvailable = (adapter?.itemCount ?: 0) > 0 && chatMessageList.isNotEmpty()
val insertNewMessagesNotice = if (newMessagesAvailable) {
chatMessageList.any { it.actorId != conversationUser!!.userId }
} else {
false
}
val scrollToEndOnUpdate = layoutManager?.findFirstVisibleItemPosition() == 0
if (insertNewMessagesNotice) {