MessageContainer

fun MessageContainer(messageListItemState: MessageListItemState, reactionSorting: ReactionSorting, messageContentFactory: MessageContentFactory = ChatTheme.messageContentFactory, 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 = {}, dateSeparatorContent: @Composable (DateSeparatorItemState) -> Unit = { DefaultMessageDateSeparatorContent(dateSeparator = it) }, unreadSeparatorContent: @Composable (UnreadSeparatorItemState) -> Unit = { DefaultMessageUnreadSeparatorContent(unreadSeparatorItemState = it) }, threadSeparatorContent: @Composable (ThreadDateSeparatorItemState) -> Unit = { DefaultMessageThreadSeparatorContent(threadSeparator = it) }, systemMessageContent: @Composable (SystemMessageItemState) -> Unit = { DefaultSystemMessageContent(systemMessageState = it) }, moderatedMessageContent: @Composable (ModeratedMessageItemState) -> Unit = { DefaultMessageModeratedContent(moderatedMessageItemState = it) }, messageItemContent: @Composable (MessageItemState) -> Unit = { DefaultMessageItem( messageItem = it, messageContentFactory = messageContentFactory, reactionSorting = reactionSorting, onLongItemClick = onLongItemClick, onReactionsClick = onReactionsClick, onThreadClick = onThreadClick, onPollUpdated = onPollUpdated, onCastVote = onCastVote, onRemoveVote = onRemoveVote, selectPoll = selectPoll, onClosePoll = onClosePoll, onAddPollOption = onAddPollOption, onGiphyActionClick = onGiphyActionClick, onMediaGalleryPreviewResult = onMediaGalleryPreviewResult, onQuotedMessageClick = onQuotedMessageClick, onUserAvatarClick = { onUserAvatarClick?.invoke(it.message.user) }, onLinkClick = onLinkClick, onUserMentionClick = onUserMentionClick, onAddAnswer = onAddAnswer, ) }, typingIndicatorContent: @Composable (TypingItemState) -> Unit = { }, emptyThreadPlaceholderItemContent: @Composable (EmptyThreadPlaceholderItemState) -> Unit = { }, startOfTheChannelItemState: @Composable (StartOfTheChannelItemState) -> Unit = { })

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

Parameters

messageListItemState

The state of the message list item.

reactionSorting

The sorting of reactions for the message.

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.

dateSeparatorContent

Composable that represents date separators.

threadSeparatorContent

Composable that represents thread separators.

systemMessageContent

Composable that represents system messages.

messageItemContent

Composable that represents regular messages.

typingIndicatorContent

Composable that represents a typing indicator.

emptyThreadPlaceholderItemContent

Composable that represents placeholders inside of an empty thread. This content is disabled by default and can be enabled via MessagesViewModelFactory.showDateSeparatorInEmptyThread or MessageListController.showDateSeparatorInEmptyThread.