Open automatically chat or call history screen when baresip icon with notification dot is touuched

This commit is contained in:
Juha Heinanen
2026-07-09 11:40:13 +03:00
parent bc4659859a
commit a5b2c14bdf
2 changed files with 29 additions and 4 deletions

View File

@ -16,6 +16,7 @@ import kotlinx.coroutines.launch
// Sealed class for type-safe navigation events
sealed class NavigationCommand {
object NavigateToHome : NavigationCommand()
object NavigateToChats : NavigationCommand()
data class NavigateToCalls(val aor: String) : NavigationCommand()
data class NavigateToChat(val aor: String, val peerUri: String) : NavigationCommand()
}
@ -31,11 +32,10 @@ class ViewModel: ViewModel() {
fun updateAorPeerMessage(aor: String, peerUri: String, message: String) {
val key = "$aor:$peerUri"
if (message.isEmpty()) {
if (message.isEmpty())
messageDrafts.remove(key)
} else {
else
messageDrafts[key] = message
}
}
data class DialerState(
@ -162,4 +162,10 @@ class ViewModel: ViewModel() {
}
}
fun navigateToChats() {
viewModelScope.launch {
_navigationCommand.emit(NavigationCommand.NavigateToChats)
}
}
}