ContactsViewModel

class ContactsViewModel(nodeRepository: NodeRepository, packetRepository: PacketRepository, radioConfigRepository: RadioConfigRepository, serviceRepository: ServiceRepository) : ViewModel(source)

Constructors

Link copied to clipboard
constructor(nodeRepository: NodeRepository, packetRepository: PacketRepository, radioConfigRepository: RadioConfigRepository, serviceRepository: ServiceRepository)

Properties

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

Non-paginated contact list.

Link copied to clipboard
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 contacts aren't loaded in the paged 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