From 18d095dc092842cc3774607603b4a1a8d02a10d1 Mon Sep 17 00:00:00 2001 From: crc-32 Date: Fri, 30 Aug 2024 00:12:48 -0400 Subject: [PATCH] use notif channel name over ID when available for mute txt --- .../io/rebble/cobble/notifications/NotificationProcessor.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/kotlin/io/rebble/cobble/notifications/NotificationProcessor.kt b/android/app/src/main/kotlin/io/rebble/cobble/notifications/NotificationProcessor.kt index 89282203..91f716c0 100644 --- a/android/app/src/main/kotlin/io/rebble/cobble/notifications/NotificationProcessor.kt +++ b/android/app/src/main/kotlin/io/rebble/cobble/notifications/NotificationProcessor.kt @@ -159,7 +159,7 @@ class NotificationProcessor @Inject constructor( listOf(TimelineAttributeFactory.title("Mute app")) ) ) - val muteChannelText = "Mute ${if (conversation) "conversation" else "channel"})" + + val muteChannelText = "Mute ${if (conversation) "conversation" else "channel"}" + if (conversation) "" else "\n'$channel'" add( TimelineItem.Action( @@ -175,7 +175,7 @@ class NotificationProcessor @Inject constructor( try { withTimeout(notificationProcessingTimeout) { val (packageId, notifId, tagId, title, text, category, color, messages, actions, sbn) = notification - val conversationId = tagId?.let { notificationChannelDao.getConversationId(sbn.packageName, it) } + val channel = tagId?.let { notificationChannelDao.get(packageId, it) } if (persistedNotifDao.getDuplicates(sbn.key, sbn.packageName, title, text).isNotEmpty()) { Timber.d("Ignoring duplicate notification ${sbn.key}") @@ -203,7 +203,7 @@ class NotificationProcessor @Inject constructor( val itemId = uuidFrom(NotificationActionHandler.notificationUuidPrefix + (uuid4().toString()).substring(NotificationActionHandler.notificationUuidPrefix.length)) val attributes = buildPebbleAttributes(packageId, category, title, text, messages, color) - val pebbleActions = buildPebbleActions(actions, tagId, conversationId != null) + val pebbleActions = buildPebbleActions(actions, channel?.name ?: tagId, channel?.conversationId != null) activeNotifsState.value += (itemId to sbn) val notificationItem = TimelineItem(