no "unread messages" popup for invisible messages

if chatMessageList is empty after handleSystemMessages it makes no sense to call the following methods.
Also processMessagesFromTheFuture was executed which caused that the popup was shown.

A better solution for the future should be to handle(remove) the "to-hide" system messages already in the repo or viewmodel

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2025-01-17 14:09:58 +01:00
parent 779c1627aa
commit 5535bed35c
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -861,14 +861,15 @@ class ChatActivity :
var chatMessageList = triple.third
chatMessageList = handleSystemMessages(chatMessageList)
if (chatMessageList.isEmpty()) {
return@onEach
}
determinePreviousMessageIds(chatMessageList)
handleExpandableSystemMessages(chatMessageList)
if (chatMessageList.isNotEmpty() &&
ChatMessage.SystemMessageType.CLEARED_CHAT == chatMessageList[0].systemMessageType
) {
if (ChatMessage.SystemMessageType.CLEARED_CHAT == chatMessageList[0].systemMessageType) {
adapter?.clear()
adapter?.notifyDataSetChanged()
}