Forráskód Böngészése

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

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 1 éve
szülő
commit
ac39e73782

+ 7 - 1
app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt

@@ -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) {