-
public final class MessageListControllerController responsible for handling message list state. It acts as a central place for core business logic and state required to show the message list, message thread and handling message actions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceMessageListController.EventRepresents errors happening in MessageListController.
public classMessageListController.ErrorEventA class designed for error event propagation.
public final classMessageListController.UnreadLabelpublic classMessageListController.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<ConnectionState>connectionStateprivate final StateFlow<User>userprivate final MutableStateFlow<MessageListController.UnreadLabel>unreadLabelStateprivate final StateFlow<Set<String>>ownCapabilitiesprivate final StateFlow<Channel>channelprivate final StateFlow<MessageMode>modeprivate final BooleanisStartedForThreadprivate final BooleanisInThreadprivate final SharedFlow<MessageListController.Event>eventsprivate final StateFlow<MessageListController.ErrorEvent>errorEventsprivate final StateFlow<Integer>unreadCountprivate final StateFlow<List<User>>typingUsersprivate final StateFlow<MessageListState>messageListStateprivate final StateFlow<PollState>pollStateprivate final StateFlow<MessageListState>threadListStateprivate final StateFlow<MessageListState>listStateprivate final StateFlow<Set<MessageAction>>messageActionsprivate final StateFlow<Boolean>showSystemMessagesStateprivate final StateFlow<MessageFooterVisibility>messageFooterVisibilityStateprivate final StateFlow<Boolean>isInsideSearchprivate final BooleanthreadLoadOrderOlderToNewerprivate final IntegermessageLimitprivate final StateFlow<ChannelState>channelState
-
Constructor Summary
Constructors Constructor Description MessageListController(String cid, ClipboardHandler clipboardHandler, Boolean threadLoadOrderOlderToNewer, String messageId, String parentMessageId, Integer messageLimit, ChatClient chatClient, ClientState clientState, StateFlow<ChannelState> channelState, Boolean showSystemMessages, MessageFooterVisibility messageFooterVisibility, Boolean enforceUniqueReactions, DateSeparatorHandler dateSeparatorHandler, DateSeparatorHandler threadDateSeparatorHandler, MessagePositionHandler messagePositionHandler, Boolean showDateSeparatorInEmptyThread, Boolean showThreadSeparatorInEmptyThread)
-
Method Summary
Modifier and Type Method Description final StateFlow<ConnectionState>getConnectionState()Gives us information about the online state of the device. final StateFlow<User>getUser()Gives us information about the logged in user state. final MutableStateFlow<MessageListController.UnreadLabel>getUnreadLabelState()The active unread boundary for this channel, or nullwhen none is shown.final StateFlow<Set<String>>getOwnCapabilities()Holds information about the abilities the current user is able to exercise in the given channel. final StateFlow<Channel>getChannel()The information for the current Channel. final StateFlow<MessageMode>getMode()final BooleangetIsStartedForThread()Gives us information if the MessageListController was started for the purpose of showing a thread. final BooleangetIsInThread()final SharedFlow<MessageListController.Event>getEvents()Flow of one-shot events emitted by the controller, such as action successes and errors. final StateFlow<MessageListController.ErrorEvent>getErrorEvents()Flow of events representing errors happening in the controller. final StateFlow<Integer>getUnreadCount()final StateFlow<List<User>>getTypingUsers()The list of typing users. final StateFlow<MessageListState>getMessageListState()final StateFlow<PollState>getPollState()final StateFlow<MessageListState>getThreadListState()final StateFlow<MessageListState>getListState()Current state of the message list depending on the MessageMode the list is in. final StateFlow<Set<MessageAction>>getMessageActions()final StateFlow<Boolean>getShowSystemMessagesState()final StateFlow<MessageFooterVisibility>getMessageFooterVisibilityState()final StateFlow<Boolean>getIsInsideSearch()Whether the user is inside search or not. final BooleangetThreadLoadOrderOlderToNewer()final IntegergetMessageLimit()final StateFlow<ChannelState>getChannelState()final UnitdisableUnreadLabelButton()Disables the unread-label button. final UnithideUnreadSeparator()Hides the unread label in the messages list (if already visible). final UnitscrollToFirstUnreadMessage()Scrolls to the first unread message in the channel. final UnitscrollToBottom(Integer messageLimit, Function0<Unit> scrollToBottom)When the user clicks the scroll to bottom button we need to take the user to the bottom of the newest messages. final UnitloadNewerMessages(String baseMessageId, Integer messageLimit)Loads newer messages of a channel following the currently newest loaded message. final UnitloadOlderMessages(Integer messageLimit)Loads more messages if we have reached the oldest message currently loaded. final UnitopenRelatedThread(Message message)Open the thread for the given message. final UnitenterThreadMode(Message parentMessage, Integer messageLimit)Changes the current _mode to be MessageMode.MessageThread and uses ChatClient to get the ThreadState for the current thread. final UnittoggleOriginalText(String messageId)Toggles between the translated and the original text of the message (if the message was auto-translated). final UnitenterNormalMode()Leaves the thread we're in and switches to MessageMode.Normal. final UnitloadMessageById(String messageId, Function1<Result<Message>, Unit> onResult)Loads a given Message with a single page around it. final UnitscrollToMessage(String messageId, String parentMessageId)Scrolls to the selected message. final UnitselectMessage(Message message)Triggered when the user long taps on and selects a message. final UnitselectReactions(Message message)Triggered when the user taps on and selects message reactions. final UnitselectExtendedReactions(Message message)Triggered when the user taps the show more reactions button. final UnitdisplayPollMoreOptions(SelectedPoll selectedPoll)Triggered when the user taps the show more options button on the poll message. final UnitupdatePollState(Poll poll, Message message, PollSelectionType pollSelectionType)Triggered when the poll information has been changed and need to sync on the poll states. final UnitperformMessageAction(MessageAction messageAction)Triggered when the user selects a new message action, in the message overlay. final UnitdismissMessageAction(MessageAction messageAction)Used to dismiss a specific message action, such as delete, reply, edit or something similar. final UnitdismissAllMessageActions()Dismisses all message actions, when we cancel them in the rest of the UI. final UnitremoveOverlay()Resets the MessagesStates, to remove the message overlay, by setting 'selectedMessageState' to null. final UnitdeleteMessage(Message message, Boolean hard)Deletes the given message. final UnitupdateLastSeenMessage(Message message)Updates the last seen message so we can determine the unread count and mark messages as read. final UnitmarkLastMessageRead()Marks that the last message in the list as read. final UnitflagMessage(Message message, String reason, Map<String, String> customData, Function1<Result<Flag>, Unit> onResult)Flags the selected message. final UnitmarkUnread(Message message, Function1<Result<Unit>, Unit> onResult)Marks the selected message as unread. final UnitupdateMessagePin(Message message)Pins or unpins the message from the current channel based on its state. final UnitpinMessage(Message message, Date expiresAt)Pins the message from the current channel. final UnitpinMessage(Message message)Pins the message from the current channel. final UnitunpinMessage(Message message)Unpins the message from the current channel. final UnitresendMessage(Message message)Resends a failed message. final UnitupdateUserMute(User user)Mutes or unmutes a user for the current user based on the users mute state. final UnitmuteUser(User user)Mutes the given user. final UnitmuteUser(String userId, Integer timeout)Mutes the given user inside this channel. final UnitunmuteUser(User user)Unmutes the given user. final UnitunmuteUser(String userId)Unmutes the given user inside this channel. final UnitcastVote(String messageId, String pollId, Option option)Cast a vote for a poll in a message. final UnitcastAnswer(String messageId, String pollId, String answer)Cast an answer for a poll in a message. final UnitremoveVote(String messageId, String pollId, Vote vote)Remove a vote for a poll in a message. final UnitclosePoll(String pollId)Close a poll in a message. final UnitclosePoll(Poll poll)Closes the given poll. final UnitreactToMessage(Reaction reaction, Message message, Boolean skipPush)Triggered when the user selects a reaction for the currently selected message. final MessagegetMessageFromListStateById(String messageId)Gets the message if it is inside the list. final UnitclearNewMessageState()Clears the new messages state and drops the unread count to 0 after the user scrolls to the newest message. final UnitbanUser(String userId, String reason, Integer timeout)Bans the given user inside this channel. final UnitunbanUser(String userId)Unbans the given user inside this channel. final UnitshadowBanUser(String userId, String reason, Integer timeout)Shadow bans the given user inside this channel. final UnitremoveShadowBanFromUser(String userId)Removes the shadow ban for the given user inside this channel. final UnitflagUser(String userId, String reason, Map<String, String> customData)Flags a user identified by the provided ID. final UnitunflagUser(String userId)Un-flags a user identified by the provided ID. final UnitblockUser(String userId)Block a user. final UnitunblockUser(String userId)Unblock a user. final UnitperformGiphyAction(GiphyAction action)Executes one of the actions for the given ephemeral giphy message. final UnitremoveAttachment(String messageId, Attachment attachmentToBeDeleted)Removes a single Attachment from a Message. final UnitsetMessagePositionHandler(MessagePositionHandler messagePositionHandler)Sets the MessagePositionHandler that determines the message position inside a group. final UnitsetDateSeparatorHandler(DateSeparatorHandler dateSeparatorHandler)Sets the date separator handler which determines when to add date separators. final UnitsetThreadDateSeparatorHandler(DateSeparatorHandler threadDateSeparatorHandler)Sets the thread date separator handler which determines when to add date separators inside the thread. final UnitsetMessageFooterVisibility(MessageFooterVisibility messageFooterVisibility)Sets the value used to determine if message footer content is shown. final UnitsetSystemMessageVisibility(Boolean areSystemMessagesVisible)Sets whether the system messages should be visible. final UnitonCleared()Cancels any pending work when the parent ViewModel is about to be destroyed. final UnitupdatePollOption(Message message, Poll poll, Option option)Updates the poll option for the given message and poll. final UnitaddPollOption(Poll poll, String option)Creates a new poll option for the given poll. final UnitaddPollOption(String pollId, String option)Creates a new poll option for the poll identified by pollId. final UnitpauseAudioRecordingAttachments()Pauses all running audio recording attachments. -
-
Constructor Detail
-
MessageListController
MessageListController(String cid, ClipboardHandler clipboardHandler, Boolean threadLoadOrderOlderToNewer, String messageId, String parentMessageId, Integer messageLimit, ChatClient chatClient, ClientState clientState, StateFlow<ChannelState> channelState, Boolean showSystemMessages, MessageFooterVisibility messageFooterVisibility, Boolean enforceUniqueReactions, DateSeparatorHandler dateSeparatorHandler, DateSeparatorHandler threadDateSeparatorHandler, MessagePositionHandler messagePositionHandler, Boolean showDateSeparatorInEmptyThread, Boolean showThreadSeparatorInEmptyThread)
- Parameters:
cid- The channel id in the format messaging:123.clipboardHandler- ClipboardHandler used to copy messages.threadLoadOrderOlderToNewer- Determines the order in which the thread messages are loaded.messageId- The message id to which we want to scroll to when opening the message list.parentMessageId- The ID of the parent message for which we want to initially load the thread.messageLimit- The limit of messages being fetched with each page od data.chatClient- The client used to communicate with the API.clientState- The current state of the SDK.channelState- The state of the channel.showSystemMessages- Determines if the system messages should be shown or not.messageFooterVisibility- Determines if and when the message footer is visible or not.enforceUniqueReactions- Determines whether the user can send only a single or multiple reactions to a message.dateSeparatorHandler- Determines the visibility of date separators inside the message list.threadDateSeparatorHandler- Determines the visibility of date separators inside the thread.messagePositionHandler- Determines the position of the message inside a group.showDateSeparatorInEmptyThread- Configures if we show a date separator when threads are empty.showThreadSeparatorInEmptyThread- Configures if we show a thread separator when threads are empty or not.
-
-
Method Detail
-
getConnectionState
final StateFlow<ConnectionState> getConnectionState()
Gives us information about the online state of the device.
-
getUser
final StateFlow<User> getUser()
Gives us information about the logged in user state.
-
getUnreadLabelState
final MutableStateFlow<MessageListController.UnreadLabel> getUnreadLabelState()
The active unread boundary for this channel, or
nullwhen none is shown.Sticky once non-null: the value persists across auto-read events until the user leaves the channel (the controller is recreated), marks messages unread, or hideUnreadSeparator is invoked. The button visibility stays consistent across recompositions of observeUnreadLabelState — see disableUnreadLabelButton for the dismissal contract.
Use this flow when only the unread boundary is relevant. UI layers consuming the aggregated channel state should prefer io.getstream.chat.android.ui.common.state.messages.list.MessageListState.unreadLabel via messageListState, which mirrors this value.
-
getOwnCapabilities
final StateFlow<Set<String>> getOwnCapabilities()
Holds information about the abilities the current user is able to exercise in the given channel.
e.g. send messages, delete messages, etc... For a full list @see ChannelCapabilities.
-
getChannel
final StateFlow<Channel> getChannel()
The information for the current Channel.
-
getMode
final StateFlow<MessageMode> getMode()
-
getIsStartedForThread
final Boolean getIsStartedForThread()
Gives us information if the MessageListController was started for the purpose of showing a thread.
-
getIsInThread
final Boolean getIsInThread()
-
getEvents
final SharedFlow<MessageListController.Event> getEvents()
Flow of one-shot events emitted by the controller, such as action successes and errors.
-
getErrorEvents
final StateFlow<MessageListController.ErrorEvent> getErrorEvents()
Flow of events representing errors happening in the controller.
-
getUnreadCount
final StateFlow<Integer> getUnreadCount()
-
getTypingUsers
final StateFlow<List<User>> getTypingUsers()
The list of typing users.
-
getMessageListState
final StateFlow<MessageListState> getMessageListState()
-
getPollState
final StateFlow<PollState> getPollState()
-
getThreadListState
final StateFlow<MessageListState> getThreadListState()
-
getListState
final StateFlow<MessageListState> getListState()
Current state of the message list depending on the MessageMode the list is in.
-
getMessageActions
final StateFlow<Set<MessageAction>> getMessageActions()
-
getShowSystemMessagesState
final StateFlow<Boolean> getShowSystemMessagesState()
-
getMessageFooterVisibilityState
final StateFlow<MessageFooterVisibility> getMessageFooterVisibilityState()
-
getIsInsideSearch
final StateFlow<Boolean> getIsInsideSearch()
Whether the user is inside search or not.
-
getThreadLoadOrderOlderToNewer
final Boolean getThreadLoadOrderOlderToNewer()
-
getMessageLimit
final Integer getMessageLimit()
-
getChannelState
final StateFlow<ChannelState> getChannelState()
-
disableUnreadLabelButton
final Unit disableUnreadLabelButton()
Disables the unread-label button.
Suppresses the button on the current label and on any label produced by future recomputations of observeUnreadLabelState, so the dismissal survives subsequent read-state changes (for example, the auto-mark-read that follows scrollToFirstUnreadMessage). The suppression is reset when the controller is recreated, i.e. when the user leaves and re-enters the channel.
-
hideUnreadSeparator
final Unit hideUnreadSeparator()
Hides the unread label in the messages list (if already visible).
-
scrollToFirstUnreadMessage
final Unit scrollToFirstUnreadMessage()
Scrolls to the first unread message in the channel.
-
scrollToBottom
final Unit scrollToBottom(Integer messageLimit, Function0<Unit> scrollToBottom)
When the user clicks the scroll to bottom button we need to take the user to the bottom of the newest messages. If the messages are not loaded we need to load them first and then scroll to the bottom of the list.
- Parameters:
messageLimit- The size of the message list page to load.scrollToBottom- Handler that notifies when the message has been loaded.
-
loadNewerMessages
final Unit loadNewerMessages(String baseMessageId, Integer messageLimit)
Loads newer messages of a channel following the currently newest loaded message. In case of threads this will do nothing.
- Parameters:
baseMessageId- The id of the most new Message inside the messages list.messageLimit- The size of the message list page to load.
-
loadOlderMessages
final Unit loadOlderMessages(Integer messageLimit)
Loads more messages if we have reached the oldest message currently loaded.
- Parameters:
messageLimit- The size of the message list page to load.
-
openRelatedThread
final Unit openRelatedThread(Message message)
Open the thread for the given message. If the message is a thread start, it will open the thread. If the message is a reply, it will open the thread for the parent message.
-
enterThreadMode
final Unit enterThreadMode(Message parentMessage, Integer messageLimit)
Changes the current _mode to be MessageMode.MessageThread and uses ChatClient to get the ThreadState for the current thread.
- Parameters:
parentMessage- The root Message which contains the thread we want to show.messageLimit- The size of the message list page to load.
-
toggleOriginalText
final Unit toggleOriginalText(String messageId)
Toggles between the translated and the original text of the message (if the message was auto-translated).
- Parameters:
messageId- The ID of the message for which to toggle the original text.
-
enterNormalMode
final Unit enterNormalMode()
Leaves the thread we're in and switches to MessageMode.Normal.
-
loadMessageById
final Unit loadMessageById(String messageId, Function1<Result<Message>, Unit> onResult)
Loads a given Message with a single page around it.
- Parameters:
messageId- The id of the Message we wish to load.onResult- Handler that notifies the result of the load action.
-
scrollToMessage
final Unit scrollToMessage(String messageId, String parentMessageId)
Scrolls to the selected message. If the message is not currently in the list it will first load a page with the message in the middle of it, add it to the list and then notify to scroll to the message.
- Parameters:
messageId- The ID of the Message we wish to scroll to.parentMessageId- The ID of the parent Message if the message we want to scroll to is in a thread.
-
selectMessage
final Unit selectMessage(Message message)
Triggered when the user long taps on and selects a message.
- Parameters:
message- The selected message.
-
selectReactions
final Unit selectReactions(Message message)
Triggered when the user taps on and selects message reactions.
- Parameters:
message- The message that contains the reactions.
-
selectExtendedReactions
final Unit selectExtendedReactions(Message message)
Triggered when the user taps the show more reactions button.
- Parameters:
message- The selected message.
-
displayPollMoreOptions
final Unit displayPollMoreOptions(SelectedPoll selectedPoll)
Triggered when the user taps the show more options button on the poll message.
- Parameters:
selectedPoll- The poll that holds the details to be drawn on the more options screen.
-
updatePollState
final Unit updatePollState(Poll poll, Message message, PollSelectionType pollSelectionType)
Triggered when the poll information has been changed and need to sync on the poll states.
- Parameters:
poll- The poll that holds the details to be drawn on the more options screen.message- The message that contains the poll information.
-
performMessageAction
final Unit performMessageAction(MessageAction messageAction)
Triggered when the user selects a new message action, in the message overlay.
We first remove the overlay, after which we consume the event and based on the type of the event, we do different things, such as starting a thread & loading thread data, showing delete or flag events and dialogs, copying the message, muting users and more.
- Parameters:
messageAction- The action the user chose.
-
dismissMessageAction
final Unit dismissMessageAction(MessageAction messageAction)
Used to dismiss a specific message action, such as delete, reply, edit or something similar.
- Parameters:
messageAction- The action to dismiss.
-
dismissAllMessageActions
final Unit dismissAllMessageActions()
Dismisses all message actions, when we cancel them in the rest of the UI.
-
removeOverlay
final Unit removeOverlay()
Resets the MessagesStates, to remove the message overlay, by setting 'selectedMessageState' to null.
-
deleteMessage
final Unit deleteMessage(Message message, Boolean hard)
Deletes the given message.
- Parameters:
message- Message to delete.hard- Whether we do a hard delete or not.
-
updateLastSeenMessage
final Unit updateLastSeenMessage(Message message)
Updates the last seen message so we can determine the unread count and mark messages as read.
- Parameters:
message- The last seen Message.
-
markLastMessageRead
final Unit markLastMessageRead()
Marks that the last message in the list as read. This also sets the unread count to 0.
-
flagMessage
final Unit flagMessage(Message message, String reason, Map<String, String> customData, Function1<Result<Flag>, Unit> onResult)
Flags the selected message.
- Parameters:
message- Message to be flagged.reason- The reason for flagging the message.customData- Additional data to send with the flag.onResult- Handler that notifies the result of the flag action.
-
markUnread
final Unit markUnread(Message message, Function1<Result<Unit>, Unit> onResult)
Marks the selected message as unread.
- Parameters:
message- Message to mark as unread.onResult- Handler that notifies the result of the mark as unread action.
-
updateMessagePin
final Unit updateMessagePin(Message message)
Pins or unpins the message from the current channel based on its state.
- Parameters:
message- The message to update the pin state of.
-
pinMessage
@JvmOverloads() final Unit pinMessage(Message message, Date expiresAt)
Pins the message from the current channel.
- Parameters:
message- The message to pin.
-
pinMessage
@JvmOverloads() final Unit pinMessage(Message message)
Pins the message from the current channel.
- Parameters:
message- The message to pin.
-
unpinMessage
final Unit unpinMessage(Message message)
Unpins the message from the current channel.
- Parameters:
message- The message to unpin.
-
resendMessage
final Unit resendMessage(Message message)
Resends a failed message.
- Parameters:
message- The Message to be resent.
-
updateUserMute
final Unit updateUserMute(User user)
Mutes or unmutes a user for the current user based on the users mute state.
- Parameters:
user- The User for which to toggle the mute state.
-
muteUser
final Unit muteUser(User user)
Mutes the given user.
- Parameters:
user- The User we wish to mute.
-
muteUser
final Unit muteUser(String userId, Integer timeout)
Mutes the given user inside this channel.
- Parameters:
userId- The ID of the user to be muted.timeout- The period of time for which the user will be muted, expressed in minutes.
-
unmuteUser
final Unit unmuteUser(User user)
Unmutes the given user.
- Parameters:
user- The User we wish to unmute.
-
unmuteUser
final Unit unmuteUser(String userId)
Unmutes the given user inside this channel.
- Parameters:
userId- The ID of the user to be unmuted.
-
castVote
final Unit castVote(String messageId, String pollId, Option option)
Cast a vote for a poll in a message.
- Parameters:
messageId- The message id where the poll is.pollId- The poll id.option- The option to vote for.
-
castAnswer
final Unit castAnswer(String messageId, String pollId, String answer)
Cast an answer for a poll in a message.
- Parameters:
messageId- The message id where the poll is.pollId- The poll id.answer- The answer to cast.
-
removeVote
final Unit removeVote(String messageId, String pollId, Vote vote)
Remove a vote for a poll in a message.
- Parameters:
messageId- The message id where the poll is.pollId- The poll id.vote- The vote that should be removed.
-
closePoll
final Unit closePoll(String pollId)
Close a poll in a message.
- Parameters:
pollId- The poll id.
-
closePoll
final Unit closePoll(Poll poll)
Closes the given poll.
- Parameters:
poll- The poll to close.
-
reactToMessage
final Unit reactToMessage(Reaction reaction, Message message, Boolean skipPush)
Triggered when the user selects a reaction for the currently selected message. If the message already has that reaction, from the current user, we remove it. Otherwise we add a new reaction.
- Parameters:
reaction- The reaction to add or remove.message- The currently selected message.skipPush- If set to "true", skips sending push notification when reacting to a message.
-
getMessageFromListStateById
final Message getMessageFromListStateById(String messageId)
Gets the message if it is inside the list.
- Parameters:
messageId- The Message id we are looking for.
-
clearNewMessageState
final Unit clearNewMessageState()
Clears the new messages state and drops the unread count to 0 after the user scrolls to the newest message.
-
banUser
final Unit banUser(String userId, String reason, Integer timeout)
Bans the given user inside this channel.
- Parameters:
userId- The ID of the user to be banned.reason- The reason for banning the user.timeout- The period of time for which the user will be banned, expressed in minutes.
-
unbanUser
final Unit unbanUser(String userId)
Unbans the given user inside this channel.
- Parameters:
userId- The ID of the user to be unbanned.
-
shadowBanUser
final Unit shadowBanUser(String userId, String reason, Integer timeout)
Shadow bans the given user inside this channel.
- Parameters:
userId- The ID of the user to be shadow banned.reason- The reason for shadow banning the user.timeout- The period of time for which the user will be shadow banned, expressed in minutes.
-
removeShadowBanFromUser
final Unit removeShadowBanFromUser(String userId)
Removes the shadow ban for the given user inside this channel.
- Parameters:
userId- The ID of the user for which the shadow ban is removed.
-
flagUser
final Unit flagUser(String userId, String reason, Map<String, String> customData)
Flags a user identified by the provided ID.
- Parameters:
userId- The ID of the user to flag.reason- The reason for flagging the user.customData- Additional key-value data submitted with the request.
-
unflagUser
@Deprecated(message = The backend no longer supports un-flagging. This call does nothing and will be removed in the next major version., level = DeprecationLevel.WARNING) final Unit unflagUser(String userId)
Un-flags a user identified by the provided ID.
- Parameters:
userId- The ID of the user to un-flag.
-
blockUser
final Unit blockUser(String userId)
Block a user. Unlike ban the block is not channel related but rather directly to the user.
- Parameters:
userId- the id of the user that will be blocked.
-
unblockUser
final Unit unblockUser(String userId)
Unblock a user.
- Parameters:
userId- the id of the user that will be unblocked.
-
performGiphyAction
final Unit performGiphyAction(GiphyAction action)
Executes one of the actions for the given ephemeral giphy message.
- Parameters:
action- The action to be executed.
-
removeAttachment
final Unit removeAttachment(String messageId, Attachment attachmentToBeDeleted)
Removes a single Attachment from a Message.
- Parameters:
messageId- The Message id that contains the attachment.attachmentToBeDeleted- The Attachment to be deleted from the message.
-
setMessagePositionHandler
final Unit setMessagePositionHandler(MessagePositionHandler messagePositionHandler)
Sets the MessagePositionHandler that determines the message position inside a group.
- Parameters:
messagePositionHandler- The MessagePositionHandler to be used when grouping the list.
-
setDateSeparatorHandler
final Unit setDateSeparatorHandler(DateSeparatorHandler dateSeparatorHandler)
Sets the date separator handler which determines when to add date separators. By default, a date separator will be added if the difference between two messages' dates is greater than 4h.
- Parameters:
dateSeparatorHandler- The handler to use.
-
setThreadDateSeparatorHandler
final Unit setThreadDateSeparatorHandler(DateSeparatorHandler threadDateSeparatorHandler)
Sets the thread date separator handler which determines when to add date separators inside the thread.
- Parameters:
threadDateSeparatorHandler- The handler to use.
-
setMessageFooterVisibility
final Unit setMessageFooterVisibility(MessageFooterVisibility messageFooterVisibility)
Sets the value used to determine if message footer content is shown.
- Parameters:
messageFooterVisibility- Changes the visibility of message footers.
-
setSystemMessageVisibility
final Unit setSystemMessageVisibility(Boolean areSystemMessagesVisible)
Sets whether the system messages should be visible.
- Parameters:
areSystemMessagesVisible- Whether system messages should be visible or not.
-
onCleared
final Unit onCleared()
Cancels any pending work when the parent ViewModel is about to be destroyed.
-
updatePollOption
final Unit updatePollOption(Message message, Poll poll, Option option)
Updates the poll option for the given message and poll.
- Parameters:
message- The message containing the poll.poll- The poll to update.option- The option to update.
-
addPollOption
final Unit addPollOption(Poll poll, String option)
Creates a new poll option for the given poll.
- Parameters:
poll- The poll to which the option will be added.option- The text of the new option to be added.
-
addPollOption
final Unit addPollOption(String pollId, String option)
Creates a new poll option for the poll identified by pollId.
- Parameters:
pollId- The id of the poll to which the option will be added.option- The text of the new option to be added.
-
pauseAudioRecordingAttachments
final Unit pauseAudioRecordingAttachments()
Pauses all running audio recording attachments.
-
-
-
-