MessageViewModel

class MessageViewModel(savedStateHandle: SavedStateHandle, nodeRepository: NodeRepository, radioConfigRepository: RadioConfigRepository, quickChatActionRepository: QuickChatActionRepository, serviceRepository: ServiceRepository, packetRepository: PacketRepository, uiPrefs: UiPrefs, customEmojiPrefs: CustomEmojiPrefs, homoglyphEncodingPrefs: HomoglyphPrefs, notificationManager: NotificationManager, sendMessageUseCase: SendMessageUseCase) : ViewModel(source)

Constructors

Link copied to clipboard
constructor(savedStateHandle: SavedStateHandle, nodeRepository: NodeRepository, radioConfigRepository: RadioConfigRepository, quickChatActionRepository: QuickChatActionRepository, serviceRepository: ServiceRepository, packetRepository: PacketRepository, uiPrefs: UiPrefs, customEmojiPrefs: CustomEmojiPrefs, homoglyphEncodingPrefs: HomoglyphPrefs, notificationManager: NotificationManager, sendMessageUseCase: SendMessageUseCase)

Properties

Link copied to clipboard
val channels: StateFlow<ChannelSet>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val filteredCount: StateFlow<Int>
Link copied to clipboard
val firstUnreadMessageUuid: StateFlow<Long?>
Link copied to clipboard
Link copied to clipboard
val hasUnreadMessages: StateFlow<Boolean?>
Link copied to clipboard
Link copied to clipboard
val nodeList: StateFlow<List<Node>>
Link copied to clipboard
val ourNodeInfo: StateFlow<Node?>
Link copied to clipboard
Link copied to clipboard
val showFiltered: StateFlow<Boolean>
Link copied to clipboard
val showQuickChat: StateFlow<Boolean>
Link copied to clipboard
val title: StateFlow<String>
Link copied to clipboard
val unreadCount: StateFlow<Int>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun clearUnreadCount(contact: String, messageUuid: Long, lastReadTimestamp: Long): Job
Link copied to clipboard
fun deleteMessages(uuidList: List<Long>): Job
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun getMessagesFlow(contactKey: String, limit: Int? = null): Flow<List<Message>>

Returns a non-paged reactive Flow of messages for a conversation. Used by desktop targets that don't use paging-compose.

Link copied to clipboard
Link copied to clipboard
fun getNode(userId: String?): Node
Link copied to clipboard
fun getUser(userId: String?): User
Link copied to clipboard
fun sendMessage(str: String, contactKey: String = "0", replyId: Int? = null)

Sends a message to a contact or channel.

Link copied to clipboard
fun sendReaction(emoji: String, replyId: Int, contactKey: String): Job
Link copied to clipboard
fun setContactFilteringDisabled(contactKey: String, disabled: Boolean)
Link copied to clipboard
fun setContactKey(contactKey: String)
Link copied to clipboard
fun setTitle(title: String)
Link copied to clipboard
Link copied to clipboard