public fun updateLastSeenMessage(message: Message) { val lastSeenMessage = if (isInThread) lastSeenThreadMessage else lastSeenChannelMessage  if (lastSeenMessage == null) { updateLastSeenMessageState(message) return }  if (message.id == lastSeenMessage.id) { return }  val lastSeenMessageDate = lastSeenMessage.createdAt ?: Date() val currentMessageDate = message.createdAt ?: Date() if (currentMessageDate < lastSeenMessageDate) { return } updateLastSeenMessageState(message) } 
Attempts to update the last seen message in the channel or thread. We only update the last seen message the first time the data loads and whenever we see a message that's newer than the current last seen message.