diff --git a/core/service/src/androidMain/kotlin/org/meshtastic/core/service/ConversationShortcutManager.kt b/core/service/src/androidMain/kotlin/org/meshtastic/core/service/ConversationShortcutManager.kt index 5c820e188..2fc0dc083 100644 --- a/core/service/src/androidMain/kotlin/org/meshtastic/core/service/ConversationShortcutManager.kt +++ b/core/service/src/androidMain/kotlin/org/meshtastic/core/service/ConversationShortcutManager.kt @@ -79,7 +79,9 @@ class ConversationShortcutManager( val channelsFlow = radioConfigRepository.channelSetFlow .map { cs -> - cs.settings.filterIndexed { index, settings -> settings.name.isNotEmpty() || index == 0 } + cs.settings.mapIndexedNotNull { index, settings -> + if (index == 0 || settings.name.isNotEmpty()) index to settings else null + } } .distinctUntilChanged() @@ -94,11 +96,11 @@ class ConversationShortcutManager( observeJob = null } - private fun publishShortcuts(favorites: List, channels: List) { + private fun publishShortcuts(favorites: List, channels: List>) { val myNodeNum = nodeRepository.myNodeInfo.value?.myNodeNum val shortcuts = favorites.filter { it.num != myNodeNum }.map { buildFavoriteShortcut(it) } + - channels.mapIndexed { index, settings -> buildChannelShortcut(settings, index) } + channels.map { (index, settings) -> buildChannelShortcut(settings, index) } try { val limit = ShortcutManagerCompat.getMaxShortcutCountPerActivity(context) diff --git a/feature/auto/src/main/kotlin/org/meshtastic/feature/auto/MeshtasticCarScreen.kt b/feature/auto/src/main/kotlin/org/meshtastic/feature/auto/MeshtasticCarScreen.kt index c90344a60..35c287f1c 100644 --- a/feature/auto/src/main/kotlin/org/meshtastic/feature/auto/MeshtasticCarScreen.kt +++ b/feature/auto/src/main/kotlin/org/meshtastic/feature/auto/MeshtasticCarScreen.kt @@ -71,7 +71,7 @@ class MeshtasticCarScreen(carContext: CarContext) : private var connectionState: ConnectionState = ConnectionState.Disconnected private var favoriteNodes: List = emptyList() - private var channels: List = emptyList() + private var channels: List> = emptyList() private var unreadCounts: Map = emptyMap() init { @@ -106,7 +106,9 @@ class MeshtasticCarScreen(carContext: CarContext) : val channelsFlow = radioConfigRepository.channelSetFlow .map { cs -> - cs.settings.filterIndexed { index, settings -> index == 0 || settings.name.isNotEmpty() } + cs.settings.mapIndexedNotNull { index, settings -> + if (index == 0 || settings.name.isNotEmpty()) index to settings else null + } } .distinctUntilChanged() @@ -114,11 +116,8 @@ class MeshtasticCarScreen(carContext: CarContext) : Triple(state, favorites, chs) } .flatMapLatest { (state, favorites, chs) -> - // Build per-conversation unread flows so the car screen invalidates - // on new messages, not just on topology/channel changes. val contactKeys = - favorites.map { "0${it.user.id}" } + - chs.mapIndexed { i, _ -> "${i}${DataPacket.ID_BROADCAST}" } + favorites.map { "0${it.user.id}" } + chs.map { (i, _) -> "${i}${DataPacket.ID_BROADCAST}" } if (contactKeys.isEmpty()) { flowOf(Triple(state, favorites, chs) to emptyMap()) @@ -204,7 +203,7 @@ class MeshtasticCarScreen(carContext: CarContext) : private fun buildChannelsSection(): ItemList { val builder = ItemList.Builder() - for ((index, channelSettings) in channels.take(MAX_LIST_ITEMS).withIndex()) { + for ((index, channelSettings) in channels.take(MAX_LIST_ITEMS)) { val contactKey = "${index}${DataPacket.ID_BROADCAST}" val unread = unreadCounts[contactKey] ?: 0 val channelName = channelSettings.name.ifEmpty { "Primary Channel" } diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties index 52234b5ce..bad5a1dc2 100644 --- a/gradle/gradle-daemon-jvm.properties +++ b/gradle/gradle-daemon-jvm.properties @@ -1 +1,13 @@ +#This file is generated by updateDaemonJvm +toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/4945f00643ec68e7c7a6b66f90124f89/redirect +toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/93aeea858331bd6bb00ba94759830234/redirect +toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/4945f00643ec68e7c7a6b66f90124f89/redirect +toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/93aeea858331bd6bb00ba94759830234/redirect +toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3426ffcaa54c3f62406beb1f1ab8b179/redirect +toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/f636c800fdb3f9ae33f019dfa048ba72/redirect +toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/4945f00643ec68e7c7a6b66f90124f89/redirect +toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/93aeea858331bd6bb00ba94759830234/redirect +toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1e91f45234d88a64dafb961c93ddc75a/redirect +toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/0ef34dd9312b12d61ba1b8e66126d140/redirect +toolchainVendor=ADOPTIUM toolchainVersion=21