ContactsViewModel

class ContactsViewModel(savedStateHandle: SavedStateHandle, nodeRepository: NodeRepository, packetRepository: PacketRepository, radioConfigRepository: RadioConfigRepository, connectionStateProvider: ConnectionStateProvider) : ViewModel(source)

Constructors

Link copied to clipboard
constructor(savedStateHandle: SavedStateHandle, nodeRepository: NodeRepository, packetRepository: PacketRepository, radioConfigRepository: RadioConfigRepository, connectionStateProvider: ConnectionStateProvider)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val channels: StateFlow<ChannelSet>
Link copied to clipboard
val collapsedSections: StateFlow<Set<String>>

Collapsed conversation-list section keys (see ContactSection), persisted across process death.

Link copied to clipboard
Link copied to clipboard
val contactList: StateFlow<List<Contact>>

Flat contact list (channels + DMs) with empty-channel placeholders merged in, consumed by both ContactsScreen and ShareScreen. ContactsScreen groups it into collapsible Channels/DirectMessages sections at render time.

Link copied to clipboard
val ourNodeInfo: StateFlow<Node?>
Link copied to clipboard
val unreadCountTotal: 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 deleteContacts(contacts: List<String>): Job
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
Link copied to clipboard
fun getNode(userId: String?): Node
Link copied to clipboard
suspend fun getTotalMessageCount(contactKeys: List<String>): Int

Get the total message count for a list of contact keys. This queries the repository directly, so it works even if a contact isn't currently loaded in the list.

Link copied to clipboard
fun markAllAsRead(): Job
Link copied to clipboard
fun setContactFilteringDisabled(contactKey: String, disabled: Boolean)
Link copied to clipboard
fun setMuteUntil(contacts: List<String>, until: Long): Job
Link copied to clipboard
fun toggleSectionCollapse(sectionKey: String)