MessageComposerViewModel
ViewModel responsible for handling the composing and sending of messages.
Delegates all state management and business logic to MessageComposerController, including persistence of picker selections and edit-mode state across process death.
Parameters
The controller used to relay all the actions and fetch all the state.
Resolves deferred attachment files before sending.
Constructors
Properties
Functions
Adds attachments to the staged attachment list.
Builds a new Message to send to our API. Based on the internal state, we use the current action's message and apply the given changes.
Removes all staged attachments.
Creates a poll with the given createPollParams.
Dismisses all message actions from the UI and clears the input based on the internal state.
Updates the UI state when leaving the thread, to switch back to the MessageMode.Normal message mode, by calling setMessageMode.
Handles the selected messageAction.
Removes attachment from the staged attachment list.
Switches the message composer to the command input mode.
Autocompletes the current text input with the mention from the selected user.
Autocompletes the current text input with the mention from the selected mention.
Sends a given message using our Stream API. Based on the internal state, we either edit an existing message, or we send a new message, using our API.
Called when the "Also send as a direct message" checkbox is checked or unchecked.
Called when the input changes and the internal state needs to be updated.
Called when the message mode changes and the internal state needs to be updated.
Sets the typing updates buffer.
Toggles the visibility of the command suggestion list popup.