Skip to content

Commit

Permalink
Not increase unread counter when an shadowed message arrives
Browse files Browse the repository at this point in the history
  • Loading branch information
JcMinarro committed Apr 5, 2024
1 parent 2637498 commit f90f077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public fun Channel.updateLastMessage(
unreadMessages = read.let {
val hasNewUnreadMessage = receivedEventDate.after(it.lastReceivedEventDate) &&
newMessages.size > messages.size &&
newMessages.last().id == message.id
newMessages.last().id == message.id &&
!message.shadowed
if (hasNewUnreadMessage) it.unreadMessages.inc() else it.unreadMessages
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ internal class ChannelStateLogic(
message.user.id == clientState.user.value?.id ||
message.parentId?.takeUnless { message.showInChannel } != null
}
?.takeUnless { message.shadowed }
?.let {
updateRead(
it.copy(
Expand Down

0 comments on commit f90f077

Please sign in to comment.