Skip to content

Commit

Permalink
no "unread messages" popup for invisible messages
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mahibi committed Jan 17, 2025
1 parent 779c162 commit 5535bed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 5535bed

Please sign in to comment.