From 78bd1ad6dd1b93be28d20383b7d03d38aacd45fb Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Wed, 7 Jan 2026 22:06:28 -0600 Subject: [PATCH] feat: Mute broadcast Reaction notifications by default (#4159) Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- .../service/MeshServiceNotificationsImpl.kt | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotificationsImpl.kt b/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotificationsImpl.kt index 5721e1db9..dda2c7664 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotificationsImpl.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotificationsImpl.kt @@ -324,7 +324,7 @@ constructor( isBroadcast: Boolean, channelName: String?, ) { - showConversationNotification(contactKey, isBroadcast, channelName) + showConversationNotification(contactKey, isBroadcast, channelName, isSilent = isBroadcast) } override suspend fun updateWaypointNotification( @@ -337,7 +337,12 @@ constructor( notificationManager.notify(contactKey.hashCode(), notification) } - private suspend fun showConversationNotification(contactKey: String, isBroadcast: Boolean, channelName: String?) { + private suspend fun showConversationNotification( + contactKey: String, + isBroadcast: Boolean, + channelName: String?, + isSilent: Boolean = false, + ) { val ourNode = nodeRepository.get().ourNodeInfo.value val history = packetRepository @@ -361,7 +366,14 @@ constructor( if (displayHistory.isEmpty()) return - val notification = createConversationNotification(contactKey, isBroadcast, channelName, displayHistory) + val notification = + createConversationNotification( + contactKey = contactKey, + isBroadcast = isBroadcast, + channelName = channelName, + history = displayHistory, + isSilent = isSilent, + ) notificationManager.notify(contactKey.hashCode(), notification) showGroupSummary() } @@ -474,10 +486,15 @@ constructor( isBroadcast: Boolean, channelName: String?, history: List, + isSilent: Boolean = false, ): Notification { val type = if (isBroadcast) NotificationType.BroadcastMessage else NotificationType.DirectMessage val builder = commonBuilder(type, createOpenMessageIntent(contactKey)) + if (isSilent) { + builder.setSilent(true) + } + val ourNode = nodeRepository.get().ourNodeInfo.value val meName = ourNode?.user?.longName ?: getString(Res.string.you) val me =