public fun getMessageWithId(messageId: String): Message? { val messageItem =currentMessagesState.messageItems.firstOrNull { it is MessageItemState && it.message.id == messageId }  return (messageItem as? MessageItemState)?.message }
Returns a message with the given ID from the [currentMessagesState].