MessageViewModel

class MessageViewModel(inbox: Inbox = MessageCenter.shared().inbox, savedStateHandle: SavedStateHandle) : ViewModel

ViewModel for MessageView.

Constructors

Link copied to clipboard
constructor(inbox: Inbox = MessageCenter.shared().inbox, savedStateHandle: SavedStateHandle)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The currently loaded Message, if we have one.

Link copied to clipboard
val states: StateFlow<MessageViewState>

A Flow of MessageView States (data consumed by the view in order to display the message).

Link copied to clipboard

A LiveData of MessageView States (data consumed by the view in order to display the message).

Functions

Link copied to clipboard

Clears the currently loaded message.

Link copied to clipboard
fun deleteMessages(vararg messages: Message)

Deletes the given list of messages.

Link copied to clipboard
fun loadMessage(messageId: String)

Loads the message with the given messageId.

Link copied to clipboard
fun markMessagesRead(vararg messages: Message)

Marks the given messages as read.

Inherited functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard
protected open fun onCleared()