From d17e715a4577e8575e5b992d5fcc3048f614b097 Mon Sep 17 00:00:00 2001 From: James Rich Date: Fri, 17 Apr 2026 08:53:11 -0500 Subject: [PATCH] fix(auto): clear unread count after inline reply ReplyReceiver was only cancelling the notification after an inline reply; PacketRepository.clearUnreadCount was never called, so the message stayed 'unread' in the app (and in the Android Auto favorites unread badges) even after the user replied from the HUN. Mirror MarkAsReadReceiver by invoking clearUnreadCount with nowMillis before cancelling the notification. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../kotlin/org/meshtastic/core/service/ReplyReceiver.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/service/src/androidMain/kotlin/org/meshtastic/core/service/ReplyReceiver.kt b/core/service/src/androidMain/kotlin/org/meshtastic/core/service/ReplyReceiver.kt index d7a943783..13fd92758 100644 --- a/core/service/src/androidMain/kotlin/org/meshtastic/core/service/ReplyReceiver.kt +++ b/core/service/src/androidMain/kotlin/org/meshtastic/core/service/ReplyReceiver.kt @@ -25,10 +25,12 @@ import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import org.koin.core.component.KoinComponent import org.koin.core.component.inject +import org.meshtastic.core.common.util.nowMillis import org.meshtastic.core.di.CoroutineDispatchers import org.meshtastic.core.model.DataPacket import org.meshtastic.core.model.RadioController import org.meshtastic.core.repository.MeshServiceNotifications +import org.meshtastic.core.repository.PacketRepository /** * A [BroadcastReceiver] that handles inline replies from notifications. @@ -44,6 +46,8 @@ class ReplyReceiver : private val meshServiceNotifications: MeshServiceNotifications by inject() + private val packetRepository: PacketRepository by inject() + private val dispatchers: CoroutineDispatchers by inject() private val scope by lazy { CoroutineScope(dispatchers.io + SupervisorJob()) } @@ -65,6 +69,7 @@ class ReplyReceiver : scope.launch { try { sendMessage(message, contactKey) + packetRepository.clearUnreadCount(contactKey, nowMillis) meshServiceNotifications.cancelMessageNotification(contactKey) } finally { pendingResult.finish()