feat: add ActionMenu option to mute contacts (#1003)

This commit is contained in:
Andre K 2024-04-28 16:18:16 -03:00 committed by GitHub
parent b409c17fe8
commit ecaf35d7f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 626 additions and 25 deletions

View file

@ -222,6 +222,12 @@ class UIViewModel @Inject constructor(
contacts + (placeholder - contacts.keys)
}.asLiveData()
val contactSettings get() = packetRepository.getContactSettings()
fun setMuteUntil(contacts: List<String>, until: Long) = viewModelScope.launch(Dispatchers.IO) {
packetRepository.setMuteUntil(contacts, until)
}
@OptIn(ExperimentalCoroutinesApi::class)
val waypoints: LiveData<Map<Int, Packet>> = _packets.mapLatest { list ->
list.filter { it.port_num == Portnums.PortNum.WAYPOINT_APP_VALUE }