MessageItem

fun LazyItemScope.MessageItem(messageListItemState: MessageListItemState, onLongItemClick: (Message) -> Unit = {}, onReactionsClick: (Message) -> Unit = {}, onThreadClick: (Message) -> Unit = {}, onPollUpdated: (Message, Poll) -> Unit = { _, _ -> }, onCastVote: (Message, Poll, Option) -> Unit = { _, _, _ -> }, onRemoveVote: (Message, Poll, Vote) -> Unit = { _, _, _ -> }, selectPoll: (Message, Poll, PollSelectionType) -> Unit = { _, _, _ -> }, onAddAnswer: (message: Message, poll: Poll, answer: String) -> Unit = { _, _, _ -> }, onClosePoll: (String) -> Unit = {}, onAddPollOption: (poll: Poll, option: String) -> Unit = { _, _ -> }, onGiphyActionClick: (GiphyAction) -> Unit = {}, onQuotedMessageClick: (Message) -> Unit = {}, onUserAvatarClick: (User) -> Unit? = null, onLinkClick: (Message, String) -> Unit? = null, onMediaGalleryPreviewResult: (MediaGalleryPreviewResult?) -> Unit = {}, onUserMentionClick: (User) -> Unit = {}, onReply: (Message) -> Unit = {})

Represents the message item container that allows us to customize each type of item in the MessageList.

The content for different message item types is provided through ChatTheme.componentFactory, allowing for customization of date separators, thread separators, system messages, moderated messages, regular messages, typing indicators, empty thread placeholders, unread separators, and start of channel items.

Parameters

messageListItemState

The state of the message list item.

onLongItemClick

Handler when the user long taps on an item.

onReactionsClick

Handler when the user taps on message reactions.

onThreadClick

Handler when the user taps on a thread within a message item.

onGiphyActionClick

Handler when the user taps on Giphy message actions.

onCastVote

Handler for casting a vote on an option.

onClosePoll

Handler for closing a poll.

onPollUpdated

Handler for updating a poll.

onQuotedMessageClick

Handler for quoted message click action.

onUserAvatarClick

Handler when users avatar is clicked.

onLinkClick

Handler for clicking on a link in the message.

onMediaGalleryPreviewResult

Handler when the user receives a result from the Media Gallery Preview.