RemoteContactsViewModel

class RemoteContactsViewModel(@Assisted val destNum: Int, nodeRepository: NodeRepository, radioController: RadioController, ensureRemoteAdminSession: EnsureRemoteAdminSessionUseCase) : ViewModel(source)

Edits the node DB of destNum, a node this radio administers remotely: send a contact and favorite it, unfavorite, ignore, unignore and remove. Candidates come from the local node DB, since firmware has no admin request that lists a remote node DB.

Constructors

Link copied to clipboard
constructor(@Assisted destNum: Int, nodeRepository: NodeRepository, radioController: RadioController, ensureRemoteAdminSession: EnsureRemoteAdminSessionUseCase)

Types

Link copied to clipboard
@AssistedFactory
fun interface Factory : ManualViewModelAssistedFactory

Properties

Link copied to clipboard
val candidates: StateFlow<List<Node>>

Every node other than destNum itself: our own node first, then local favorites, then most recently heard. One without a trusted key stays listed, since only sending it as a contact needs a key: see hasTrustedKey.

Link copied to clipboard
val destNode: StateFlow<Node?>
Link copied to clipboard
Link copied to clipboard
val lastResult: StateFlow<RemoteWriteResult?>
Link copied to clipboard
val query: StateFlow<String>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun perform(node: Node, action: RemoteContactAction)
Link copied to clipboard
fun setQuery(query: String)