public fun focusMessage(messageId: String) { val messages = currentMessagesState.messageItems.map { if (it is MessageItemState && it.message.id == messageId) { it.copy(focusState = MessageFocused) } else { it } }  viewModelScope.launch { updateMessages(messages) delay(RemoveMessageFocusDelay) removeMessageFocus(messageId) } }
Sets the focused message to be the message with the given ID, after which it removes it from focus with a delay.